KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > in > co > daffodil > db > jdbc > DBClientConnection


1 package in.co.daffodil.db.jdbc;
2
3 import java.sql.Connection JavaDoc;
4 import java.sql.Statement JavaDoc;
5 import java.sql.SQLException JavaDoc;
6 import java.sql.PreparedStatement JavaDoc;
7 import java.sql.CallableStatement JavaDoc;
8 import java.sql.DatabaseMetaData JavaDoc;
9 import java.sql.SQLWarning JavaDoc;
10 import java.util.Map JavaDoc;
11 import java.sql.*;
12
13 public class DBClientConnection implements Connection JavaDoc {
14
15    DBPooledConnection dbPooledConnection;
16    Connection JavaDoc connection;
17
18    public DBClientConnection(DBPooledConnection dbPooledConnection0,Connection JavaDoc connection0){
19       dbPooledConnection = dbPooledConnection0;
20       connection = connection0;
21    }
22
23    public Statement JavaDoc createStatement() throws SQLException JavaDoc {
24          return connection.createStatement();
25    }
26    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql) throws SQLException JavaDoc {
27         return connection.prepareStatement(sql);
28    }
29    public CallableStatement JavaDoc prepareCall(String JavaDoc sql) throws SQLException JavaDoc {
30         return connection.prepareCall(sql);
31    }
32
33    public String JavaDoc nativeSQL(String JavaDoc sql) throws SQLException JavaDoc {
34         return connection.nativeSQL(sql);
35    }
36
37    public void setAutoCommit(boolean autoCommit) throws SQLException JavaDoc {
38       if ( dbPooledConnection.inGlobatTransaction() )
39              throw new SQLException JavaDoc( "Cannot commit/rollback a connection managed by the transaction manager" );
40       connection.setAutoCommit(autoCommit);
41    }
42
43    public boolean getAutoCommit() throws SQLException JavaDoc {
44         return connection.getAutoCommit();
45    }
46
47    public void commit() throws SQLException JavaDoc {
48       if ( dbPooledConnection.inGlobatTransaction() )
49          throw new SQLException JavaDoc( "Cannot commit/rollback a connection managed by the transaction manager" );
50         connection.commit();
51    }
52
53    public void rollback() throws SQLException JavaDoc {
54         connection.rollback();
55    }
56
57    public void close() throws SQLException JavaDoc {
58       if ( dbPooledConnection.inGlobatTransaction() )
59           dbPooledConnection.notifyClose();
60    }
61
62    public boolean isClosed() throws SQLException JavaDoc {
63           return !dbPooledConnection.inGlobatTransaction() ;
64    }
65
66    public DatabaseMetaData JavaDoc getMetaData() throws SQLException JavaDoc {
67         return connection.getMetaData();
68    }
69
70    public void setReadOnly(boolean readOnly) throws SQLException JavaDoc {
71         connection.setReadOnly(readOnly);
72    }
73
74    public boolean isReadOnly() throws SQLException JavaDoc {
75         return connection.isReadOnly();
76    }
77
78    public void setCatalog(String JavaDoc catalog) throws SQLException JavaDoc {
79         connection.setCatalog(catalog);
80    }
81
82    public String JavaDoc getCatalog() throws SQLException JavaDoc {
83         return connection.getCatalog();
84    }
85
86    public void setTransactionIsolation(int level) throws SQLException JavaDoc {
87         connection.setTransactionIsolation(level);
88    }
89
90    public int getTransactionIsolation() throws SQLException JavaDoc {
91         return connection.getTransactionIsolation();
92    }
93
94    public SQLWarning JavaDoc getWarnings() throws SQLException JavaDoc {
95         return connection.getWarnings();
96    }
97
98    public void clearWarnings() throws SQLException JavaDoc {
99         connection.clearWarnings();
100    }
101
102    public Statement JavaDoc createStatement(int resultSetType, int resultSetConcurrency) throws SQLException JavaDoc {
103         return connection.createStatement(resultSetType,resultSetConcurrency);
104    }
105
106    public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int resultSetType, int resultSetConcurrency) throws SQLException JavaDoc {
107         return connection.prepareStatement(sql,resultSetType,resultSetConcurrency);
108    }
109
110    public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int resultSetType, int resultSetConcurrency) throws SQLException JavaDoc {
111         return connection.prepareCall(sql,resultSetType,resultSetConcurrency);
112    }
113
114    public Map JavaDoc getTypeMap() throws SQLException JavaDoc {
115         return connection.getTypeMap();
116    }
117
118    public void setTypeMap(Map JavaDoc map) throws SQLException JavaDoc {
119         connection.setTypeMap(map);
120    }
121   public void setHoldability(int holdability) throws SQLException JavaDoc {
122     /**@todo Implement this java.sql.Connection method*/
123     throw new java.lang.UnsupportedOperationException JavaDoc("Method setHoldability() not yet implemented.");
124   }
125   public int getHoldability() throws SQLException JavaDoc {
126     /**@todo Implement this java.sql.Connection method*/
127     throw new java.lang.UnsupportedOperationException JavaDoc("Method getHoldability() not yet implemented.");
128   }
129   public Savepoint setSavepoint() throws SQLException JavaDoc {
130     /**@todo Implement this java.sql.Connection method*/
131     throw new java.lang.UnsupportedOperationException JavaDoc("Method setSavepoint() not yet implemented.");
132   }
133   public Savepoint setSavepoint(String JavaDoc name) throws SQLException JavaDoc {
134     /**@todo Implement this java.sql.Connection method*/
135     throw new java.lang.UnsupportedOperationException JavaDoc("Method setSavepoint() not yet implemented.");
136   }
137   public void rollback(Savepoint savepoint) throws SQLException JavaDoc {
138     /**@todo Implement this java.sql.Connection method*/
139     throw new java.lang.UnsupportedOperationException JavaDoc("Method rollback() not yet implemented.");
140   }
141   public void releaseSavepoint(Savepoint savepoint) throws SQLException JavaDoc {
142     /**@todo Implement this java.sql.Connection method*/
143     throw new java.lang.UnsupportedOperationException JavaDoc("Method releaseSavepoint() not yet implemented.");
144   }
145   public Statement JavaDoc createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException JavaDoc {
146     /**@todo Implement this java.sql.Connection method*/
147     throw new java.lang.UnsupportedOperationException JavaDoc("Method createStatement() not yet implemented.");
148   }
149   public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException JavaDoc {
150     /**@todo Implement this java.sql.Connection method*/
151     throw new java.lang.UnsupportedOperationException JavaDoc("Method prepareStatement() not yet implemented.");
152   }
153   public CallableStatement JavaDoc prepareCall(String JavaDoc sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException JavaDoc {
154     /**@todo Implement this java.sql.Connection method*/
155     throw new java.lang.UnsupportedOperationException JavaDoc("Method prepareCall() not yet implemented.");
156   }
157   public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int autoGeneratedKeys) throws SQLException JavaDoc {
158     /**@todo Implement this java.sql.Connection method*/
159     throw new java.lang.UnsupportedOperationException JavaDoc("Method prepareStatement() not yet implemented.");
160   }
161   public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, int[] columnIndexes) throws SQLException JavaDoc {
162     /**@todo Implement this java.sql.Connection method*/
163     throw new java.lang.UnsupportedOperationException JavaDoc("Method prepareStatement() not yet implemented.");
164   }
165   public PreparedStatement JavaDoc prepareStatement(String JavaDoc sql, String JavaDoc[] columnNames) throws SQLException JavaDoc {
166     /**@todo Implement this java.sql.Connection method*/
167     throw new java.lang.UnsupportedOperationException JavaDoc("Method prepareStatement() not yet implemented.");
168   }
169 }
170
Popular Tags