/bonecp-jdk-compat/src/main/java/java/sql/Connection.java

http://github.com/wwadge/bonecp · Java · 110 lines · 83 code · 5 blank · 22 comment · 0 complexity · de041d1486382c710990471cf4916c07 MD5 · raw file

  1. /**
  2. * Copyright 2010 Wallace Wadge
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. /**
  17. *
  18. */
  19. package java.sql;
  20. /**
  21. * @author wwadge
  22. *
  23. */
  24. import java.util.Properties;
  25. import java.util.concurrent.Executor;
  26. public interface Connection{
  27. int TRANSACTION_NONE = 0;
  28. int TRANSACTION_READ_UNCOMMITTED = 1;
  29. int TRANSACTION_READ_COMMITTED = 2;
  30. int TRANSACTION_REPEATABLE_READ = 4;
  31. int TRANSACTION_SERIALIZABLE = 8;
  32. Statement createStatement() throws SQLException;
  33. PreparedStatement prepareStatement(String sql)
  34. throws SQLException;
  35. CallableStatement prepareCall(String sql) throws SQLException;
  36. String nativeSQL(String sql) throws SQLException;
  37. void setAutoCommit(boolean autoCommit) throws SQLException;
  38. boolean getAutoCommit() throws SQLException;
  39. void commit() throws SQLException;
  40. void rollback() throws SQLException;
  41. void close() throws SQLException;
  42. boolean isClosed() throws SQLException;
  43. DatabaseMetaData getMetaData() throws SQLException;
  44. void setReadOnly(boolean readOnly) throws SQLException;
  45. boolean isReadOnly() throws SQLException;
  46. void setCatalog(String catalog) throws SQLException;
  47. String getCatalog() throws SQLException;
  48. void setTransactionIsolation(int level) throws SQLException;
  49. int getTransactionIsolation() throws SQLException;
  50. SQLWarning getWarnings() throws SQLException;
  51. void clearWarnings() throws SQLException;
  52. Statement createStatement(int resultSetType, int resultSetConcurrency)
  53. throws SQLException;
  54. PreparedStatement prepareStatement(String sql, int resultSetType,
  55. int resultSetConcurrency)
  56. throws SQLException;
  57. CallableStatement prepareCall(String sql, int resultSetType,
  58. int resultSetConcurrency) throws SQLException;
  59. java.util.Map<String,Class<?>> getTypeMap() throws SQLException;
  60. void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException;
  61. void setHoldability(int holdability) throws SQLException;
  62. int getHoldability() throws SQLException;
  63. Savepoint setSavepoint() throws SQLException;
  64. Savepoint setSavepoint(String name) throws SQLException;
  65. void rollback(Savepoint savepoint) throws SQLException;
  66. void releaseSavepoint(Savepoint savepoint) throws SQLException;
  67. Statement createStatement(int resultSetType, int resultSetConcurrency,
  68. int resultSetHoldability) throws SQLException;
  69. PreparedStatement prepareStatement(String sql, int resultSetType,
  70. int resultSetConcurrency, int resultSetHoldability)
  71. throws SQLException;
  72. CallableStatement prepareCall(String sql, int resultSetType,
  73. int resultSetConcurrency,
  74. int resultSetHoldability) throws SQLException;
  75. PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
  76. throws SQLException;
  77. PreparedStatement prepareStatement(String sql, int columnIndexes[])
  78. throws SQLException;
  79. PreparedStatement prepareStatement(String sql, String columnNames[])
  80. throws SQLException;
  81. Clob createClob() throws SQLException;
  82. Blob createBlob() throws SQLException;
  83. NClob createNClob() throws SQLException;
  84. SQLXML createSQLXML() throws SQLException;
  85. boolean isValid(int timeout) throws SQLException;
  86. void setClientInfo(String name, String value)
  87. throws SQLClientInfoException;
  88. void setClientInfo(Properties properties)
  89. throws SQLClientInfoException;
  90. String getClientInfo(String name)
  91. throws SQLException;
  92. Properties getClientInfo()
  93. throws SQLException;
  94. Array createArrayOf(String typeName, Object[] elements) throws
  95. SQLException;
  96. Struct createStruct(String typeName, Object[] attributes)
  97. throws SQLException;
  98. void setSchema(String schema) throws SQLException;
  99. String getSchema() throws SQLException;
  100. void abort(Executor executor) throws SQLException;
  101. void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException;
  102. int getNetworkTimeout() throws SQLException;
  103. boolean isWrapperFor(Class<?> iface) throws SQLException;
  104. <T> T unwrap(Class<T> iface) throws SQLException;
  105. }