< prev index next >

jdk/src/java.sql/share/classes/javax/sql/DataSource.java

Print this page




 102    * @return  a connection to the data source
 103    * @exception SQLException if a database access error occurs
 104    * @throws java.sql.SQLTimeoutException  when the driver has determined that the
 105    * timeout value specified by the {@code setLoginTimeout} method
 106    * has been exceeded and has at least tried to cancel the
 107    * current database connection attempt
 108    * @since 1.4
 109    */
 110   Connection getConnection(String username, String password)
 111     throws SQLException;
 112 
 113   // JDBC 4.3
 114 
 115   /**
 116    * Create a new {@code ConnectionBuilder} instance
 117    * @implSpec
 118    * The default implementation will throw a {@code SQLFeatureNotSupportedException}
 119    * @return The ConnectionBuilder instance that was created
 120    * @throws SQLException if an error occurs creating the builder
 121    * @throws SQLFeatureNotSupportedException if the driver does not support sharding
 122    * @since 1.9
 123    * @see createConnectionBuilder
 124    */
 125   default ConnectionBuilder createConnectionBuilder() throws SQLException {
 126         throw new SQLFeatureNotSupportedException("createConnectionBuilder not implemented");
 127   };
 128 
 129   /**
 130    * Create a new {@code ShardingKeyBuilder} instance
 131    * @implSpec
 132    * The default implementation will throw a {@code SQLFeatureNotSupportedException}
 133    * @return The ShardingKeyBuilder instance that was created
 134    * @throws SQLException if an error occurs creating the builder
 135    * @throws SQLFeatureNotSupportedException if the driver does not support this method
 136    * @since 1.9
 137    * @see ShardingKeyBuilder
 138    */
 139   default ShardingKeyBuilder  createShardingKeyBuilder()
 140           throws SQLException {
 141         throw new SQLFeatureNotSupportedException("createShardingKeyBuilder not implemented");
 142   };
 143 }


 102    * @return  a connection to the data source
 103    * @exception SQLException if a database access error occurs
 104    * @throws java.sql.SQLTimeoutException  when the driver has determined that the
 105    * timeout value specified by the {@code setLoginTimeout} method
 106    * has been exceeded and has at least tried to cancel the
 107    * current database connection attempt
 108    * @since 1.4
 109    */
 110   Connection getConnection(String username, String password)
 111     throws SQLException;
 112 
 113   // JDBC 4.3
 114 
 115   /**
 116    * Create a new {@code ConnectionBuilder} instance
 117    * @implSpec
 118    * The default implementation will throw a {@code SQLFeatureNotSupportedException}
 119    * @return The ConnectionBuilder instance that was created
 120    * @throws SQLException if an error occurs creating the builder
 121    * @throws SQLFeatureNotSupportedException if the driver does not support sharding
 122    * @since 9
 123    * @see createConnectionBuilder
 124    */
 125   default ConnectionBuilder createConnectionBuilder() throws SQLException {
 126         throw new SQLFeatureNotSupportedException("createConnectionBuilder not implemented");
 127   };
 128 
 129   /**
 130    * Create a new {@code ShardingKeyBuilder} instance
 131    * @implSpec
 132    * The default implementation will throw a {@code SQLFeatureNotSupportedException}
 133    * @return The ShardingKeyBuilder instance that was created
 134    * @throws SQLException if an error occurs creating the builder
 135    * @throws SQLFeatureNotSupportedException if the driver does not support this method
 136    * @since 9
 137    * @see ShardingKeyBuilder
 138    */
 139   default ShardingKeyBuilder  createShardingKeyBuilder()
 140           throws SQLException {
 141         throw new SQLFeatureNotSupportedException("createShardingKeyBuilder not implemented");
 142   };
 143 }
< prev index next >