KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openbravo > database > ConnectionProvider


1 /*
2  ************************************************************************************
3  * Copyright (C) 2001-2006 Openbravo S.L.
4  * Licensed under the Apache Software License version 2.0
5  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6  * Unless required by applicable law or agreed to in writing, software distributed
7  * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
8  * CONDITIONS OF ANY KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations under the License.
10  ************************************************************************************
11 */

12 package org.openbravo.database;
13
14 import java.sql.*;
15 import org.openbravo.exception.*;
16
17 public interface ConnectionProvider {
18   public Connection getConnection() throws NoConnectionAvailableException;
19   public String JavaDoc getRDBMS();
20   public Connection getTransactionConnection() throws NoConnectionAvailableException, SQLException;
21   public void releaseCommitConnection(Connection conn) throws SQLException;
22   public void releaseRollbackConnection(Connection conn) throws SQLException;
23   public PreparedStatement getPreparedStatement(String JavaDoc poolName, String JavaDoc strSql) throws Exception JavaDoc;
24   public PreparedStatement getPreparedStatement(String JavaDoc strSql) throws Exception JavaDoc;
25   public PreparedStatement getPreparedStatement(Connection conn, String JavaDoc strSql) throws SQLException;
26   public void releasePreparedStatement(PreparedStatement preparedStatement) throws SQLException;
27   public Statement getStatement(String JavaDoc poolName) throws Exception JavaDoc;
28   public Statement getStatement() throws Exception JavaDoc;
29   public Statement getStatement(Connection conn) throws SQLException;
30   public void releaseStatement(Statement statement) throws SQLException;
31   public void releaseTransactionalStatement(Statement statement) throws SQLException;
32   public void releaseTransactionalPreparedStatement(PreparedStatement preparedStatement) throws SQLException;
33   public CallableStatement getCallableStatement(String JavaDoc poolName, String JavaDoc strSql) throws Exception JavaDoc;
34   public CallableStatement getCallableStatement(String JavaDoc strSql) throws Exception JavaDoc;
35   public CallableStatement getCallableStatement(Connection conn, String JavaDoc strSql) throws SQLException;
36   public void releaseCallableStatement(CallableStatement callableStatement) throws SQLException;
37 }
38
Popular Tags