Dmconnection interface

  1. packagecom.mdj.dmdatabase.pool;
  2. importjava.io.IOException;
  3. importjava.io.PrintWriter;
  4. importjava.sql.Connection;
  5. importjava.sql.DatabaseMetaData;
  6. importjava.sql.ResultSet;
  7. importjava.sql.SQLException;
  8. importjava.util.List;
  9. importjava.util.Map;
  10. importjava.util.Vector;
  11. importjavax.xml.parsers.DocumentBuilder;
  12. importjavax.xml.parsers.DocumentBuilderFactory;
  13. importjavax.xml.parsers.ParserConfigurationException;
  14. importorg.w3c.dom.Document;
  15. importorg.w3c.dom.Element;
  16. importorg.w3c.dom.NodeList;
  17. importorg.xml.sax.SAXException;
  18. importcom.mdj.dmdatabase.develop.DmDataSource;
  19. /**
  20. *@since<ahref="http://blog.csdn.net/mak0000">Connectionpool
  21. *EasyconnectionPool</a>
  22. *@author武汉软件工程职业学院<br>
  23. *孟德军<br>
  24. *2009-01-01
  25. *@version2.0
  26. */
  27. publicabstractclassDmconnectionimplementsDmDataSource,DatabaseMetaData{
  28. /**
  29. *
  30. */
  31. privatestaticfinallongserialVersionUID=1L;
  32. /**
  33. *@see#databasemetaData数据源.
  34. */
  35. privateDatabaseMetaDatadatabasemetaData;
  36. /**
  37. *@see#resultset存放数据库的表信息.
  38. */
  39. privateResultSetresultset=null;
  40. /**
  41. *@see#map存放mapexecuteQuery查询结果
  42. */
  43. privateMapmap=null;
  44. /**
  45. *@see#list存放listexecuteQuery查询结果
  46. */
  47. privateListlist=null;
  48. /**
  49. *@see#con数据库连接
  50. */
  51. Connectioncon=null;
  52. /**
  53. *@see#pool连接池容器.可自行选择。
  54. */
  55. Vector<Connection>pool=null;
  56. /**
  57. *@see#driverclass数据库驱动类
  58. */
  59. Stringdriverclass=null;
  60. /**
  61. *@see#uername数据库用户名
  62. */
  63. Stringusername=null;
  64. /**
  65. *@see#password数据库密码
  66. */
  67. Stringpassword=null;
  68. /**
  69. *@see#url连接数据库url
  70. */
  71. Stringurl=null;
  72. /**
  73. *@see#filepath配置文件路径.
  74. */
  75. Stringfilepath=null;
  76. /**
  77. *@see#logpath日志文件路径.
  78. */
  79. Stringlogpath=null;
  80. /**
  81. *@see#maxwaittime允许等待时间
  82. */
  83. intmaxwaittime=0;
  84. /**
  85. *@see#delaytime延迟时间
  86. */
  87. intdelaytime=0;
  88. /**
  89. *@see#maxconnection最大连接
  90. */
  91. intmaxconnection=0;
  92. /**
  93. *@see#minconnection最小连接
  94. */
  95. intminconnection=0;
  96. /**
  97. *@see#poolsize连接池大小.
  98. */
  99. intpoolsize=0;
  100. /**
  101. *@see#addConnection()为连接池添加连接
  102. *@throwsClassNotFoundException
  103. */
  104. privatevoidaddConnection()throwsClassNotFoundException{
  105. }
  106. /**
  107. *@see#releaseConnection(Connection)释放连接,返还连接池.
  108. *@see#con当前连接.
  109. *
  110. */
  111. publicsynchronizedConnectiongetConnection()throwsSQLException{
  112. returncon;
  113. }
  114. /**
  115. *@see#releaseConnection(Connection)释放连接,返还连接池.
  116. *@paramcon
  117. *当前连接.
  118. */
  119. publicsynchronizedConnectiongetConnection(Stringusername,
  120. Stringpassword){
  121. returncon;
  122. }
  123. publicsynchronizedvoidreleaseConnection(Connectioncon){
  124. }
  125. /**
  126. *
  127. *@see#closeConnectionPool()关闭连接,清空连接池.
  128. *@throwsSQLException
  129. */
  130. publicvoidcloseConnectionPool()throwsSQLException{
  131. }
  132. /**
  133. *@see#scaner()扫描连接池.
  134. */
  135. privatevoidscaner(){
  136. }
  137. /**
  138. *@see#config(String)读取配置文件.
  139. *@paramfilepath
  140. *配置文件路径.
  141. *@throwsSAXException
  142. *
  143. */
  144. privatevoidconfig(Stringpath)throwsParserConfigurationException,
  145. IOException,SAXException{
  146. DocumentBuilderFactoryfactory=DocumentBuilderFactory.newInstance();
  147. DocumentBuilderbuilder=factory.newDocumentBuilder();
  148. Documentdocument=builder.parse(path);
  149. NodeListnodelist=document.getElementsByTagName("dbmsdriver");
  150. for(inti=0;i<nodelist.getLength();i++){
  151. Elementelement=(Element)nodelist.item(i);
  152. driverclass=element.getElementsByTagName("driverclass").item(0)
  153. .getFirstChild().getNodeValue();
  154. url=element.getElementsByTagName("url").item(0).getFirstChild()
  155. .getNodeValue();
  156. username=element.getElementsByTagName("username").item(0)
  157. .getFirstChild().getNodeValue();
  158. password=element.getElementsByTagName("password").item(0)
  159. .getFirstChild().getNodeValue();
  160. maxconnection=Integer.parseInt(element.getElementsByTagName(
  161. "maxconnection").item(0).getFirstChild().getNodeValue());
  162. minconnection=Integer.parseInt(element.getElementsByTagName(
  163. "minconnection").item(0).getFirstChild().getNodeValue());
  164. logpath=element.getElementsByTagName("logpath").item(0)
  165. .getFirstChild().getNodeValue();
  166. maxwaittime=Integer.parseInt(element.getElementsByTagName(
  167. "maxwait").item(0).getFirstChild().getNodeValue());
  168. delaytime=Integer.parseInt(element
  169. .getElementsByTagName("maxwait").item(0).getFirstChild()
  170. .getNodeValue());
  171. }
  172. }
  173. /**
  174. *@see#serverlog(String)日志.
  175. *@parammsg
  176. *异常及日常信息.
  177. *@since<ahref="http://www.w3.org/xmlschema">建议将变量以配置文件形式存放,<br>
  178. *以方便使用,例如xml,properties<br>
  179. *文件.</a>
  180. */
  181. privatevoidserverlog(Stringmsg){
  182. }
  183. /**
  184. *@see#setLogWriter(PrintWriter)设置延时
  185. *@throwsSQLException
  186. */
  187. publicvoidsetLoginTimeout(intseconds)throwsSQLException{
  188. }
  189. /**
  190. *@see#getLoginTimeout()获取延时。
  191. *@throwsSQLException
  192. */
  193. publicabstractintgetLoginTimeout()throwsSQLException;
  194. /**
  195. *@see#setLogWriter(PrintWriter)设置日志.
  196. *@throwsSQLException
  197. */
  198. @SuppressWarnings("unused")
  199. publicabstractvoidsetLogWriter(PrintWriterout)throwsSQLException;
  200. /**
  201. *@see#getLogWriter()获取日志
  202. *@throwsSQLException
  203. */
  204. publicabstractPrintWritergetLogWriter()throwsSQLException;
  205. publicintgetJDBCMajorVersion()throwsSQLException{
  206. //TODOAuto-generatedmethodstub
  207. return0;
  208. }
  209. publicResultSetgetTables(Stringcatalog,Stringschemapattern,
  210. Stringtablenamepattern,String[]types)throwsSQLException{
  211. //TODOAuto-generatedmethodstub
  212. returnnull;
  213. }
  214. publicListlistexecuteQuery(Stringsql,Classbeanclass)
  215. throwsSQLException{
  216. //TODOAuto-generatedmethodstub
  217. returnnull;
  218. }
  219. publicMapmapexecuteQuery(Stringsql)throwsSQLException{
  220. //TODOAuto-generatedmethodstub
  221. returnnull;
  222. }
  223. publicbooleanallProceduresAreCallable()throwsSQLException{
  224. //TODOAuto-generatedmethodstub
  225. returnfalse;
  226. }
  227. publicbooleanallTablesAreSelectable()throwsSQLException{
  228. //TODOAuto-generatedmethodstub
  229. returnfalse;
  230. }
  231. publicbooleandataDefinitionCausesTransactionCommit()throwsSQLException{
  232. //TODOAuto-generatedmethodstub
  233. returnfalse;
  234. }
  235. publicbooleandataDefinitionIgnoredInTransactions()throwsSQLException{
  236. //TODOAuto-generatedmethodstub
  237. returnfalse;
  238. }
  239. publicbooleandeletesAreDetected(intarg0)throwsSQLException{
  240. //TODOAuto-generatedmethodstub
  241. returnfalse;
  242. }
  243. publicbooleandoesMaxRowSizeIncludeBlobs()throwsSQLException{
  244. //TODOAuto-generatedmethodstub
  245. returnfalse;
  246. }
  247. publicResultSetgetAttributes(Stringarg0,Stringarg1,Stringarg2,
  248. Stringarg3)throwsSQLException{
  249. //TODOAuto-generatedmethodstub
  250. returnnull;
  251. }
  252. publicResultSetgetBestRowIdentifier(Stringarg0,Stringarg1,
  253. Stringarg2,intarg3,booleanarg4)throwsSQLException{
  254. //TODOAuto-generatedmethodstub
  255. returnnull;
  256. }
  257. publicResultSetgetCatalogs()throwsSQLException{
  258. //TODOAuto-generatedmethodstub
  259. returnnull;
  260. }
  261. publicStringgetCatalogSeparator()throwsSQLException{
  262. //TODOAuto-generatedmethodstub
  263. returnnull;
  264. }
  265. publicStringgetCatalogTerm()throwsSQLException{
  266. //TODOAuto-generatedmethodstub
  267. returnnull;
  268. }
  269. publicResultSetgetColumnPrivileges(Stringarg0,Stringarg1,Stringarg2,
  270. Stringarg3)throwsSQLException{
  271. //TODOAuto-generatedmethodstub
  272. returnnull;
  273. }
  274. publicResultSetgetColumns(Stringarg0,Stringarg1,Stringarg2,
  275. Stringarg3)throwsSQLException{
  276. //TODOAuto-generatedmethodstub
  277. returnnull;
  278. }
  279. publicResultSetgetCrossReference(Stringarg0,Stringarg1,Stringarg2,
  280. Stringarg3,Stringarg4,Stringarg5)throwsSQLException{
  281. //TODOAuto-generatedmethodstub
  282. returnnull;
  283. }
  284. publicintgetDatabaseMajorVersion()throwsSQLException{
  285. //TODOAuto-generatedmethodstub
  286. return0;
  287. }
  288. publicintgetDatabaseMinorVersion()throwsSQLException{
  289. //TODOAuto-generatedmethodstub
  290. return0;
  291. }
  292. publicStringgetDatabaseProductName()throwsSQLException{
  293. //TODOAuto-generatedmethodstub
  294. returnnull;
  295. }
  296. publicStringgetDatabaseProductVersion()throwsSQLException{
  297. //TODOAuto-generatedmethodstub
  298. returnnull;
  299. }
  300. publicintgetDefaultTransactionIsolation()throwsSQLException{
  301. //TODOAuto-generatedmethodstub
  302. return0;
  303. }
  304. publicintgetDriverMajorVersion(){
  305. //TODOAuto-generatedmethodstub
  306. return0;
  307. }
  308. publicintgetDriverMinorVersion(){
  309. //TODOAuto-generatedmethodstub
  310. return0;
  311. }
  312. publicStringgetDriverName()throwsSQLException{
  313. //TODOAuto-generatedmethodstub
  314. returnnull;
  315. }
  316. publicStringgetDriverVersion()throwsSQLException{
  317. //TODOAuto-generatedmethodstub
  318. returnnull;
  319. }
  320. publicResultSetgetExportedKeys(Stringarg0,Stringarg1,Stringarg2)
  321. throwsSQLException{
  322. //TODOAuto-generatedmethodstub
  323. returnnull;
  324. }
  325. publicStringgetExtraNameCharacters()throwsSQLException{
  326. //TODOAuto-generatedmethodstub
  327. returnnull;
  328. }
  329. publicStringgetIdentifierQuoteString()throwsSQLException{
  330. //TODOAuto-generatedmethodstub
  331. returnnull;
  332. }
  333. publicResultSetgetImportedKeys(Stringarg0,Stringarg1,Stringarg2)
  334. throwsSQLException{
  335. //TODOAuto-generatedmethodstub
  336. returnnull;
  337. }
  338. publicResultSetgetIndexInfo(Stringarg0,Stringarg1,Stringarg2,
  339. booleanarg3,booleanarg4)throwsSQLException{
  340. //TODOAuto-generatedmethodstub
  341. returnnull;
  342. }
  343. publicintgetJDBCMinorVersion()throwsSQLException{
  344. //TODOAuto-generatedmethodstub
  345. return0;
  346. }
  347. publicintgetMaxBinaryLiteralLength()throwsSQLException{
  348. //TODOAuto-generatedmethodstub
  349. return0;
  350. }
  351. publicintgetMaxCatalogNameLength()throwsSQLException{
  352. //TODOAuto-generatedmethodstub
  353. return0;
  354. }
  355. publicintgetMaxCharLiteralLength()throwsSQLException{
  356. //TODOAuto-generatedmethodstub
  357. return0;
  358. }
  359. publicintgetMaxColumnNameLength()throwsSQLException{
  360. //TODOAuto-generatedmethodstub
  361. return0;
  362. }
  363. publicintgetMaxColumnsInGroupBy()throwsSQLException{
  364. //TODOAuto-generatedmethodstub
  365. return0;
  366. }
  367. publicintgetMaxColumnsInIndex()throwsSQLException{
  368. //TODOAuto-generatedmethodstub
  369. return0;
  370. }
  371. publicintgetMaxColumnsInOrderBy()throwsSQLException{
  372. //TODOAuto-generatedmethodstub
  373. return0;
  374. }
  375. publicintgetMaxColumnsInSelect()throwsSQLException{
  376. //TODOAuto-generatedmethodstub
  377. return0;
  378. }
  379. publicintgetMaxColumnsInTable()throwsSQLException{
  380. //TODOAuto-generatedmethodstub
  381. return0;
  382. }
  383. publicintgetMaxConnections()throwsSQLException{
  384. //TODOAuto-generatedmethodstub
  385. return0;
  386. }
  387. publicintgetMaxCursorNameLength()throwsSQLException{
  388. //TODOAuto-generatedmethodstub
  389. return0;
  390. }
  391. publicintgetMaxIndexLength()throwsSQLException{
  392. //TODOAuto-generatedmethodstub
  393. return0;
  394. }
  395. publicintgetMaxProcedureNameLength()throwsSQLException{
  396. //TODOAuto-generatedmethodstub
  397. return0;
  398. }
  399. publicintgetMaxRowSize()throwsSQLException{
  400. //TODOAuto-generatedmethodstub
  401. return0;
  402. }
  403. publicintgetMaxSchemaNameLength()throwsSQLException{
  404. //TODOAuto-generatedmethodstub
  405. return0;
  406. }
  407. publicintgetMaxStatementLength()throwsSQLException{
  408. //TODOAuto-generatedmethodstub
  409. return0;
  410. }
  411. publicintgetMaxStatements()throwsSQLException{
  412. //TODOAuto-generatedmethodstub
  413. return0;
  414. }
  415. publicintgetMaxTableNameLength()throwsSQLException{
  416. //TODOAuto-generatedmethodstub
  417. return0;
  418. }
  419. publicintgetMaxTablesInSelect()throwsSQLException{
  420. //TODOAuto-generatedmethodstub
  421. return0;
  422. }
  423. publicintgetMaxUserNameLength()throwsSQLException{
  424. //TODOAuto-generatedmethodstub
  425. return0;
  426. }
  427. publicStringgetNumericFunctions()throwsSQLException{
  428. //TODOAuto-generatedmethodstub
  429. returnnull;
  430. }
  431. publicResultSetgetPrimaryKeys(Stringarg0,Stringarg1,Stringarg2)
  432. throwsSQLException{
  433. //TODOAuto-generatedmethodstub
  434. returnnull;
  435. }
  436. publicResultSetgetProcedureColumns(Stringarg0,Stringarg1,Stringarg2,
  437. Stringarg3)throwsSQLException{
  438. //TODOAuto-generatedmethodstub
  439. returnnull;
  440. }
  441. publicResultSetgetProcedures(Stringarg0,Stringarg1,Stringarg2)
  442. throwsSQLException{
  443. //TODOAuto-generatedmethodstub
  444. returnnull;
  445. }
  446. publicStringgetProcedureTerm()throwsSQLException{
  447. //TODOAuto-generatedmethodstub
  448. returnnull;
  449. }
  450. publicintgetResultSetHoldability()throwsSQLException{
  451. //TODOAuto-generatedmethodstub
  452. return0;
  453. }
  454. publicResultSetgetSchemas()throwsSQLException{
  455. //TODOAuto-generatedmethodstub
  456. returnnull;
  457. }
  458. publicStringgetSchemaTerm()throwsSQLException{
  459. //TODOAuto-generatedmethodstub
  460. returnnull;
  461. }
  462. publicStringgetSearchStringEscape()throwsSQLException{
  463. //TODOAuto-generatedmethodstub
  464. returnnull;
  465. }
  466. publicStringgetSQLKeywords()throwsSQLException{
  467. //TODOAuto-generatedmethodstub
  468. returnnull;
  469. }
  470. publicintgetSQLStateType()throwsSQLException{
  471. //TODOAuto-generatedmethodstub
  472. return0;
  473. }
  474. publicStringgetStringFunctions()throwsSQLException{
  475. //TODOAuto-generatedmethodstub
  476. returnnull;
  477. }
  478. publicResultSetgetSuperTables(Stringarg0,Stringarg1,Stringarg2)
  479. throwsSQLException{
  480. //TODOAuto-generatedmethodstub
  481. returnnull;
  482. }
  483. publicResultSetgetSuperTypes(Stringarg0,Stringarg1,Stringarg2)
  484. throwsSQLException{
  485. //TODOAuto-generatedmethodstub
  486. returnnull;
  487. }
  488. publicStringgetSystemFunctions()throwsSQLException{
  489. //TODOAuto-generatedmethodstub
  490. returnnull;
  491. }
  492. publicResultSetgetTablePrivileges(Stringarg0,Stringarg1,Stringarg2)
  493. throwsSQLException{
  494. //TODOAuto-generatedmethodstub
  495. returnnull;
  496. }
  497. publicResultSetgetTableTypes()throwsSQLException{
  498. //TODOAuto-generatedmethodstub
  499. returnnull;
  500. }
  501. publicStringgetTimeDateFunctions()throwsSQLException{
  502. //TODOAuto-generatedmethodstub
  503. returnnull;
  504. }
  505. publicResultSetgetTypeInfo()throwsSQLException{
  506. //TODOAuto-generatedmethodstub
  507. returnnull;
  508. }
  509. publicResultSetgetUDTs(Stringarg0,Stringarg1,Stringarg2,int[]arg3)
  510. throwsSQLException{
  511. //TODOAuto-generatedmethodstub
  512. returnnull;
  513. }
  514. publicStringgetURL()throwsSQLException{
  515. //TODOAuto-generatedmethodstub
  516. returnnull;
  517. }
  518. publicStringgetUserName()throwsSQLException{
  519. //TODOAuto-generatedmethodstub
  520. returnnull;
  521. }
  522. publicResultSetgetVersionColumns(Stringarg0,Stringarg1,Stringarg2)
  523. throwsSQLException{
  524. //TODOAuto-generatedmethodstub
  525. returnnull;
  526. }
  527. publicbooleaninsertsAreDetected(intarg0)throwsSQLException{
  528. //TODOAuto-generatedmethodstub
  529. returnfalse;
  530. }
  531. publicbooleanisCatalogAtStart()throwsSQLException{
  532. //TODOAuto-generatedmethodstub
  533. returnfalse;
  534. }
  535. publicbooleanisReadOnly()throwsSQLException{
  536. //TODOAuto-generatedmethodstub
  537. returnfalse;
  538. }
  539. publicbooleanlocatorsUpdateCopy()throwsSQLException{
  540. //TODOAuto-generatedmethodstub
  541. returnfalse;
  542. }
  543. publicbooleannullPlusNonNullIsNull()throwsSQLException{
  544. //TODOAuto-generatedmethodstub
  545. returnfalse;
  546. }
  547. publicbooleannullsAreSortedAtEnd()throwsSQLException{
  548. //TODOAuto-generatedmethodstub
  549. returnfalse;
  550. }
  551. publicbooleannullsAreSortedAtStart()throwsSQLException{
  552. //TODOAuto-generatedmethodstub
  553. returnfalse;
  554. }
  555. publicbooleannullsAreSortedHigh()throwsSQLException{
  556. //TODOAuto-generatedmethodstub
  557. returnfalse;
  558. }
  559. publicbooleannullsAreSortedLow()throwsSQLException{
  560. //TODOAuto-generatedmethodstub
  561. returnfalse;
  562. }
  563. publicbooleanothersDeletesAreVisible(intarg0)throwsSQLException{
  564. //TODOAuto-generatedmethodstub
  565. returnfalse;
  566. }
  567. publicbooleanothersInsertsAreVisible(intarg0)throwsSQLException{
  568. //TODOAuto-generatedmethodstub
  569. returnfalse;
  570. }
  571. publicbooleanothersUpdatesAreVisible(intarg0)throwsSQLException{
  572. //TODOAuto-generatedmethodstub
  573. returnfalse;
  574. }
  575. publicbooleanownDeletesAreVisible(intarg0)throwsSQLException{
  576. //TODOAuto-generatedmethodstub
  577. returnfalse;
  578. }
  579. publicbooleanownInsertsAreVisible(intarg0)throwsSQLException{
  580. //TODOAuto-generatedmethodstub
  581. returnfalse;
  582. }
  583. publicbooleanownUpdatesAreVisible(intarg0)throwsSQLException{
  584. //TODOAuto-generatedmethodstub
  585. returnfalse;
  586. }
  587. publicbooleanstoresLowerCaseIdentifiers()throwsSQLException{
  588. //TODOAuto-generatedmethodstub
  589. returnfalse;
  590. }
  591. publicbooleanstoresLowerCaseQuotedIdentifiers()throwsSQLException{
  592. //TODOAuto-generatedmethodstub
  593. returnfalse;
  594. }
  595. publicbooleanstoresMixedCaseIdentifiers()throwsSQLException{
  596. //TODOAuto-generatedmethodstub
  597. returnfalse;
  598. }
  599. publicbooleanstoresMixedCaseQuotedIdentifiers()throwsSQLException{
  600. //TODOAuto-generatedmethodstub
  601. returnfalse;
  602. }
  603. publicbooleanstoresUpperCaseIdentifiers()throwsSQLException{
  604. //TODOAuto-generatedmethodstub
  605. returnfalse;
  606. }
  607. publicbooleanstoresUpperCaseQuotedIdentifiers()throwsSQLException{
  608. //TODOAuto-generatedmethodstub
  609. returnfalse;
  610. }
  611. publicbooleansupportsAlterTableWithAddColumn()throwsSQLException{
  612. //TODOAuto-generatedmethodstub
  613. returnfalse;
  614. }
  615. publicbooleansupportsAlterTableWithDropColumn()throwsSQLException{
  616. //TODOAuto-generatedmethodstub
  617. returnfalse;
  618. }
  619. publicbooleansupportsANSI92EntryLevelSQL()throwsSQLException{
  620. //TODOAuto-generatedmethodstub
  621. returnfalse;
  622. }
  623. publicbooleansupportsANSI92FullSQL()throwsSQLException{
  624. //TODOAuto-generatedmethodstub
  625. returnfalse;
  626. }
  627. publicbooleansupportsANSI92IntermediateSQL()throwsSQLException{
  628. //TODOAuto-generatedmethodstub
  629. returnfalse;
  630. }
  631. publicbooleansupportsBatchUpdates()throwsSQLException{
  632. //TODOAuto-generatedmethodstub
  633. returnfalse;
  634. }
  635. publicbooleansupportsCatalogsInDataManipulation()throwsSQLException{
  636. //TODOAuto-generatedmethodstub
  637. returnfalse;
  638. }
  639. publicbooleansupportsCatalogsInIndexDefinitions()throwsSQLException{
  640. //TODOAuto-generatedmethodstub
  641. returnfalse;
  642. }
  643. publicbooleansupportsCatalogsInPrivilegeDefinitions()throwsSQLException{
  644. //TODOAuto-generatedmethodstub
  645. returnfalse;
  646. }
  647. publicbooleansupportsCatalogsInProcedureCalls()throwsSQLException{
  648. //TODOAuto-generatedmethodstub
  649. returnfalse;
  650. }
  651. publicbooleansupportsCatalogsInTableDefinitions()throwsSQLException{
  652. //TODOAuto-generatedmethodstub
  653. returnfalse;
  654. }
  655. publicbooleansupportsColumnAliasing()throwsSQLException{
  656. //TODOAuto-generatedmethodstub
  657. returnfalse;
  658. }
  659. publicbooleansupportsConvert()throwsSQLException{
  660. //TODOAuto-generatedmethodstub
  661. returnfalse;
  662. }
  663. publicbooleansupportsConvert(intarg0,intarg1)throwsSQLException{
  664. //TODOAuto-generatedmethodstub
  665. returnfalse;
  666. }
  667. publicbooleansupportsCoreSQLGrammar()throwsSQLException{
  668. //TODOAuto-generatedmethodstub
  669. returnfalse;
  670. }
  671. publicbooleansupportsCorrelatedSubqueries()throwsSQLException{
  672. //TODOAuto-generatedmethodstub
  673. returnfalse;
  674. }
  675. publicbooleansupportsDataDefinitionAndDataManipulationTransactions()
  676. throwsSQLException{
  677. //TODOAuto-generatedmethodstub
  678. returnfalse;
  679. }
  680. publicbooleansupportsDataManipulationTransactionsOnly()
  681. throwsSQLException{
  682. //TODOAuto-generatedmethodstub
  683. returnfalse;
  684. }
  685. publicbooleansupportsDifferentTableCorrelationNames()throwsSQLException{
  686. //TODOAuto-generatedmethodstub
  687. returnfalse;
  688. }
  689. publicbooleansupportsExpressionsInOrderBy()throwsSQLException{
  690. //TODOAuto-generatedmethodstub
  691. returnfalse;
  692. }
  693. publicbooleansupportsExtendedSQLGrammar()throwsSQLException{
  694. //TODOAuto-generatedmethodstub
  695. returnfalse;
  696. }
  697. publicbooleansupportsFullOuterJoins()throwsSQLException{
  698. //TODOAuto-generatedmethodstub
  699. returnfalse;
  700. }
  701. publicbooleansupportsGetGeneratedKeys()throwsSQLException{
  702. //TODOAuto-generatedmethodstub
  703. returnfalse;
  704. }
  705. publicbooleansupportsGroupBy()throwsSQLException{
  706. //TODOAuto-generatedmethodstub
  707. returnfalse;
  708. }
  709. publicbooleansupportsGroupByBeyondSelect()throwsSQLException{
  710. //TODOAuto-generatedmethodstub
  711. returnfalse;
  712. }
  713. publicbooleansupportsGroupByUnrelated()throwsSQLException{
  714. //TODOAuto-generatedmethodstub
  715. returnfalse;
  716. }
  717. publicbooleansupportsIntegrityEnhancementFacility()throwsSQLException{
  718. //TODOAuto-generatedmethodstub
  719. returnfalse;
  720. }
  721. publicbooleansupportsLikeEscapeClause()throwsSQLException{
  722. //TODOAuto-generatedmethodstub
  723. returnfalse;
  724. }
  725. publicbooleansupportsLimitedOuterJoins()throwsSQLException{
  726. //TODOAuto-generatedmethodstub
  727. returnfalse;
  728. }
  729. publicbooleansupportsMinimumSQLGrammar()throwsSQLException{
  730. //TODOAuto-generatedmethodstub
  731. returnfalse;
  732. }
  733. publicbooleansupportsMixedCaseIdentifiers()throwsSQLException{
  734. //TODOAuto-generatedmethodstub
  735. returnfalse;
  736. }
  737. publicbooleansupportsMixedCaseQuotedIdentifiers()throwsSQLException{
  738. //TODOAuto-generatedmethodstub
  739. returnfalse;
  740. }
  741. publicbooleansupportsMultipleOpenResults()throwsSQLException{
  742. //TODOAuto-generatedmethodstub
  743. returnfalse;
  744. }
  745. publicbooleansupportsMultipleResultSets()throwsSQLException{
  746. //TODOAuto-generatedmethodstub
  747. returnfalse;
  748. }
  749. publicbooleansupportsMultipleTransactions()throwsSQLException{
  750. //TODOAuto-generatedmethodstub
  751. returnfalse;
  752. }
  753. publicbooleansupportsNamedParameters()throwsSQLException{
  754. //TODOAuto-generatedmethodstub
  755. returnfalse;
  756. }
  757. publicbooleansupportsNonNullableColumns()throwsSQLException{
  758. //TODOAuto-generatedmethodstub
  759. returnfalse;
  760. }
  761. publicbooleansupportsOpenCursorsAcrossCommit()throwsSQLException{
  762. //TODOAuto-generatedmethodstub
  763. returnfalse;
  764. }
  765. publicbooleansupportsOpenCursorsAcrossRollback()throwsSQLException{
  766. //TODOAuto-generatedmethodstub
  767. returnfalse;
  768. }
  769. publicbooleansupportsOpenStatementsAcrossCommit()throwsSQLException{
  770. //TODOAuto-generatedmethodstub
  771. returnfalse;
  772. }
  773. publicbooleansupportsOpenStatementsAcrossRollback()throwsSQLException{
  774. //TODOAuto-generatedmethodstub
  775. returnfalse;
  776. }
  777. publicbooleansupportsOrderByUnrelated()throwsSQLException{
  778. //TODOAuto-generatedmethodstub
  779. returnfalse;
  780. }
  781. publicbooleansupportsOuterJoins()throwsSQLException{
  782. //TODOAuto-generatedmethodstub
  783. returnfalse;
  784. }
  785. publicbooleansupportsPositionedDelete()throwsSQLException{
  786. //TODOAuto-generatedmethodstub
  787. returnfalse;
  788. }
  789. publicbooleansupportsPositionedUpdate()throwsSQLException{
  790. //TODOAuto-generatedmethodstub
  791. returnfalse;
  792. }
  793. publicbooleansupportsResultSetConcurrency(intarg0,intarg1)
  794. throwsSQLException{
  795. //TODOAuto-generatedmethodstub
  796. returnfalse;
  797. }
  798. publicbooleansupportsResultSetHoldability(intarg0)throwsSQLException{
  799. //TODOAuto-generatedmethodstub
  800. returnfalse;
  801. }
  802. publicbooleansupportsResultSetType(intarg0)throwsSQLException{
  803. //TODOAuto-generatedmethodstub
  804. returnfalse;
  805. }
  806. publicbooleansupportsSavepoints()throwsSQLException{
  807. //TODOAuto-generatedmethodstub
  808. returnfalse;
  809. }
  810. publicbooleansupportsSchemasInDataManipulation()throwsSQLException{
  811. //TODOAuto-generatedmethodstub
  812. returnfalse;
  813. }
  814. publicbooleansupportsSchemasInIndexDefinitions()throwsSQLException{
  815. //TODOAuto-generatedmethodstub
  816. returnfalse;
  817. }
  818. publicbooleansupportsSchemasInPrivilegeDefinitions()throwsSQLException{
  819. //TODOAuto-generatedmethodstub
  820. returnfalse;
  821. }
  822. publicbooleansupportsSchemasInProcedureCalls()throwsSQLException{
  823. //TODOAuto-generatedmethodstub
  824. returnfalse;
  825. }
  826. publicbooleansupportsSchemasInTableDefinitions()throwsSQLException{
  827. //TODOAuto-generatedmethodstub
  828. returnfalse;
  829. }
  830. publicbooleansupportsSelectForUpdate()throwsSQLException{
  831. //TODOAuto-generatedmethodstub
  832. returnfalse;
  833. }
  834. publicbooleansupportsStatementPooling()throwsSQLException{
  835. //TODOAuto-generatedmethodstub
  836. returnfalse;
  837. }
  838. publicbooleansupportsStoredProcedures()throwsSQLException{
  839. //TODOAuto-generatedmethodstub
  840. returnfalse;
  841. }
  842. publicbooleansupportsSubqueriesInComparisons()throwsSQLException{
  843. //TODOAuto-generatedmethodstub
  844. returnfalse;
  845. }
  846. publicbooleansupportsSubqueriesInExists()throwsSQLException{
  847. //TODOAuto-generatedmethodstub
  848. returnfalse;
  849. }
  850. publicbooleansupportsSubqueriesInIns()throwsSQLException{
  851. //TODOAuto-generatedmethodstub
  852. returnfalse;
  853. }
  854. publicbooleansupportsSubqueriesInQuantifieds()throwsSQLException{
  855. //TODOAuto-generatedmethodstub
  856. returnfalse;
  857. }
  858. publicbooleansupportsTableCorrelationNames()throwsSQLException{
  859. //TODOAuto-generatedmethodstub
  860. returnfalse;
  861. }
  862. publicbooleansupportsTransactionIsolationLevel(intarg0)
  863. throwsSQLException{
  864. //TODOAuto-generatedmethodstub
  865. returnfalse;
  866. }
  867. publicbooleansupportsTransactions()throwsSQLException{
  868. //TODOAuto-generatedmethodstub
  869. returnfalse;
  870. }
  871. publicbooleansupportsUnion()throwsSQLException{
  872. //TODOAuto-generatedmethodstub
  873. returnfalse;
  874. }
  875. publicbooleansupportsUnionAll()throwsSQLException{
  876. //TODOAuto-generatedmethodstub
  877. returnfalse;
  878. }
  879. publicbooleanupdatesAreDetected(intarg0)throwsSQLException{
  880. //TODOAuto-generatedmethodstub
  881. returnfalse;
  882. }
  883. publicbooleanusesLocalFilePerTable()throwsSQLException{
  884. //TODOAuto-generatedmethodstub
  885. returnfalse;
  886. }
  887. publicbooleanusesLocalFiles()throwsSQLException{
  888. //TODOAuto-generatedmethodstub
  889. returnfalse;
  890. }
  891. }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
package com.hexiang.utils.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; import org.apache.log4j.Logger; public class DBConnection { /** * 获得与数据库的连接 * * @param path * @return Connection */ public static Connection getConn(String classDriver, String url, String user, String pwd) { try { Class.forName(classDriver); return DriverManager.getConnection(url, user, pwd); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } catch (SQLException ex) { ex.printStackTrace(); } return null; } public static Connection getConn(DataSource dataSource) { try { return dataSource.getConnection(); } catch (SQLException ex) { ex.printStackTrace(); } return null; } public static Connection getConn(String jndiName) { try { Context ctx; ctx = new InitialContext(); DataSource dataSource = (DataSource) ctx.lookup("java:comp/env/" + jndiName); return dataSource.getConnection(); } catch (NamingException ex) { ex.printStackTrace(); } catch (SQLException ex) { ex.printStackTrace(); } return null; } public static Connection getConn(Properties properties) { try { String driver = properties.getProperty("jdbc.driverClassName"); String url = properties.getProperty("jdbc.url"); String user = properties.getProperty("jdbc.username"); String password = properties.getProperty("jdbc.password"); Class.forName(driver); return DriverManager.getConnection(url, user, password); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } catch (SQLException ex) { ex.printStackTrace(); } return null; } /** * oracle连接 * * @param path * @return Connection */ public static Connection getOracleConn(String

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值