001    package railo.runtime.db;
002    
003    import java.sql.Connection;
004    import java.sql.PreparedStatement;
005    import java.sql.SQLException;
006    
007    /**
008     * a datasource and connection pair
009     */
010    public interface DatasourceConnection {
011    
012        /**
013         * @return Returns the connection.
014         */
015        public abstract Connection getConnection();
016    
017        /**
018         * @return Returns the datasource.
019         */
020        public abstract DataSource getDatasource();
021    
022        /**
023         * @return is timeout or not
024         */
025        public abstract boolean isTimeout();
026        
027    
028    
029            /**
030             * @return the password
031             */
032            public String getPassword();
033    
034            /**
035             * @return the username
036             */
037            public String getUsername() ;
038    
039            public boolean supportsGetGeneratedKeys();
040            
041            public PreparedStatement getPreparedStatement(SQL sql, boolean createGeneratedKeys, boolean allowCaching) throws SQLException;
042            public PreparedStatement getPreparedStatement(SQL sql, int resultSetType,int resultSetConcurrency) throws SQLException;
043            
044            public void close() throws SQLException;
045            
046            
047    
048            
049    }