Name
DataSource
Synopsis
A factory for java.sql.Connection
objects. Can be registered with a JNDI service, so that an application can get the name of a database from a name service.
public interface DataSource { // Public Instance Methods public abstract java.sql.Connection getConnection( ) throws java.sql.SQLException; public abstract java.sql.Connection getConnection( String username, String password) throws java.sql.SQLException; public abstract int getLoginTimeout( ) throws java.sql.SQLException; public abstract PrintWriter getLogWriter( ) throws java.sql.SQLException; public abstract void setLoginTimeout( int seconds) throws java.sql.SQLException; public abstract void setLogWriter( PrintWriter out) throws java.sql.SQLException; }
Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.