Public Member Functions | |
Connection () | |
Connection (Driver driver, Socket socket, CJDBCInputStream in, CJDBCOutputStream out, String url, String userName, String password, boolean sqlSkeletonNeeded, AbstractBlobFilter filter) | |
String | getURL () |
String | getUserName () |
String | getPassword () |
String | getConnectedController () |
void | clearWarnings () throws SQLException |
void | close () throws SQLException |
void | commit () throws SQLException |
java.sql.Statement | createStatement () throws SQLException |
java.sql.Statement | createStatement (int resultSetType, int resultSetConcurrency) throws SQLException |
boolean | getAutoCommit () throws SQLException |
java.sql.DatabaseMetaData | getMetaData () throws SQLException |
String | getCatalog () throws SQLException |
ResultSet | getCatalogs () throws SQLException |
int | getTransactionIsolation () throws SQLException |
java.util.Map | getTypeMap () throws SQLException |
SQLWarning | getWarnings () throws SQLException |
boolean | isClosed () throws SQLException |
boolean | isReadOnly () throws SQLException |
String | nativeSQL (String query) throws SQLException |
java.sql.CallableStatement | prepareCall (String sql) throws SQLException |
java.sql.CallableStatement | prepareCall (String sql, int resultSetType, int resultSetConcurrency) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql, int resultSetType, int resultSetConcurrency) throws SQLException |
void | rollback () throws SQLException |
void | setAutoCommit (boolean autoCommit) throws SQLException |
void | setCatalog (String catalog) throws SQLException |
void | setReadOnly (boolean readOnly) throws SQLException |
void | setTransactionIsolation (int level) throws SQLException |
void | setTypeMap (java.util.Map map) throws SQLException |
ResultSet | execReadStoredProcedure (StoredProcedure proc) throws SQLException |
Object | getStaticMetadata (String key) throws SQLException |
String | getControllerVersionNumber () throws SQLException |
void | setHoldability (int holdability) throws SQLException |
int | getHoldability () throws SQLException |
Savepoint | setSavepoint () throws SQLException |
Savepoint | setSavepoint (String name) throws SQLException |
void | rollback (Savepoint savepoint) throws SQLException |
void | releaseSavepoint (Savepoint savepoint) throws SQLException |
java.sql.Statement | createStatement (int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException |
java.sql.CallableStatement | prepareCall (String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql, int autoGeneratedKeys) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql, int columnIndexes[]) throws SQLException |
java.sql.PreparedStatement | prepareStatement (String sql, String columnNames[]) throws SQLException |
AbstractBlobFilter | getBlobFilter () |
ResultSet | getTableTypes () throws SQLException |
ResultSet | getTablePrivileges (String catalog, String schemaPattern, String tableNamePattern) throws SQLException |
ResultSet | getSchemas () throws SQLException |
String | getDatabaseProductName () throws SQLException |
void | fetchNextData (String cursorName, int fetchSize, DriverResultSet drsToUpdate) throws SQLException |
void | closeRemoteResultSet (String cursorName) throws SQLException |
String | getPreparedStatementBooleanFalse () |
void | setPreparedStatementBooleanFalse (String booleanFalse) |
String | getPreparedStatementBooleanTrue () |
void | setPreparedStatementBooleanTrue (String booleanTrue) |
boolean | isEscapeBackslash () |
void | setEscapeBackslash (boolean escapeBackslash) |
boolean | isEscapeSingleQuote () |
void | setEscapeSingleQuote (boolean escapeSingleQuote) |
void | setDriverProcessed (boolean processedByDriver) |
boolean | isDriverProcessed () |
void | setEscapeChar (String escapeChar) |
String | getEscapeChar () |
Static Public Attributes | |
final String | TAG_MARKER = "!%" |
final String | TAG_MARKER_ESCAPE = TAG_MARKER + ";" |
final String | START_PARAM_TAG = "<" + TAG_MARKER |
final String | END_PARAM_TAG = "|" + TAG_MARKER + ">" |
Protected Member Functions | |
void | finalize () throws Throwable |
java.sql.ResultSet | getProcedures (String catalog, String schemaPattern, String procedureNamePattern) throws SQLException |
java.sql.ResultSet | getProcedureColumns (String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException |
void | setConnectionParametersOnRequest (AbstractRequest request) |
java.sql.ResultSet | execReadRequest (SelectRequest request) throws SQLException |
void | setCloseSocketOnGC (boolean closeSocketOnGC) |
int | execWriteRequest (AbstractWriteRequest request) throws SQLException |
ResultSet | execWriteRequestWithKeys (AbstractWriteRequest request) throws SQLException |
int | execWriteStoredProcedure (StoredProcedure proc) throws SQLException |
ResultSet | getColumns (String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException |
ResultSet | getPrimaryKeys (String catalog, String schemaPattern, String tableNamePattern) throws SQLException |
ResultSet | getTables (String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException |
Protected Attributes | |
boolean | autoCommit = true |
boolean | isClosed = false |
boolean | readOnly = false |
int | isolationLevel = java.sql.Connection.TRANSACTION_READ_COMMITTED |
long | transactionId = 0 |
boolean | needSqlSkeleton = false |
SQLWarning | firstWarning = null |
DatabaseMetaData | metaData = null |
Driver | driver = null |
String | url = null |
String | vdbUser = null |
String | vdbPassword = null |
Socket | socket |
CJDBCInputStream | socketInput |
CJDBCOutputStream | socketOutput |
boolean | escapeBackslash = true |
boolean | escapeSingleQuote = true |
boolean | driverProcessed = true |
String | preparedStatementBooleanTrue = "'1'" |
String | preparedStatementBooleanFalse = "'0'" |
String | escapeChar = "\'" |
Static Protected Attributes | |
final String | LINE_SEPARATOR |
Package Attributes | |
boolean | writeExecutedInTransaction = false |
Connection
class implements a virtual connection that is just used to store the needed information when the real connection will have to be established by the Controller to execute a query. This code has been inspired from the PostgreSQL JDBC driver by Peter T. Mount.
Definition at line 67 of file Connection.java.
|
Creates a new Definition at line 159 of file Connection.java. 00160 { 00161 }
|
|
Creates a new
Definition at line 177 of file Connection.java. 00180 { 00181 this.driver = driver; 00182 this.socket = socket; 00183 this.socketInput = in; 00184 this.socketOutput = out; 00185 this.url = url; 00186 this.vdbUser = userName; 00187 this.vdbPassword = password; 00188 this.needSqlSkeleton = sqlSkeletonNeeded; 00189 this.blobFilter = filter; 00190 }
|
|
After this call,
Definition at line 281 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.firstWarning. 00282 { 00283 firstWarning = null; 00284 }
|
|
Releases the connection. In fact, the connection is marked to be released but will be effectively closed by the
Definition at line 293 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.autoCommit, org.objectweb.cjdbc.driver.Driver.connectionClosingThreadisAlive, org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.isClosed, org.objectweb.cjdbc.driver.Driver.pendingConnectionClosing, org.objectweb.cjdbc.driver.Connection.readOnly, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.Statement.close(), org.objectweb.cjdbc.driver.Statement.executeQuery(), org.objectweb.cjdbc.driver.Statement.executeUpdateWithSkeleton(), org.objectweb.cjdbc.driver.Connection.finalize(), and org.objectweb.cjdbc.driver.Statement.getMoreResults(). 00294 { 00295 // We synchronize here in the case 2 threads try to call close() 00296 // concurrently on this connection. 00297 synchronized (this) 00298 { 00299 if (isClosed) 00300 return; 00301 else 00302 isClosed = true; 00303 } 00304 00305 try 00306 { 00307 autoCommit = true; 00308 readOnly = false; 00309 socketOutput.writeInt(Commands.Reset); 00310 socketOutput.flush(); 00311 } 00312 catch (Exception e) 00313 { 00314 throw new SQLException("Error while closing the connection: " + e); 00315 } 00316 00317 synchronized (driver.pendingConnectionClosing) 00318 { 00319 if (!driver.connectionClosingThreadisAlive) 00320 { // First connection to close, start a new closing thread 00321 ConnectionClosingThread t = new ConnectionClosingThread(driver); 00322 t.start(); 00323 } 00324 // Add to the list 00325 driver.pendingConnectionClosing.add(this); 00326 } 00327 }
|
|
Closes the remote ResultSet given its cursor name.
Definition at line 2202 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DriverResultSet.close(). 02203 { 02204 try 02205 { 02206 socketOutput.writeInt(Commands.CloseRemoteResultSet); 02207 socketOutput.writeUTF(cursorName); 02208 socketOutput.flush(); 02209 02210 Object data = socketInput.readObject(); 02211 if (data instanceof CommandCompleted) 02212 return; 02213 else if (data instanceof SQLException) 02214 throw (SQLException) data; 02215 else 02216 throw new SQLException( 02217 "Connection.closeRemoteResultSet: Unexpected response (" + data 02218 + ")"); 02219 } 02220 catch (Exception e) 02221 { 02222 throw new SQLException( 02223 "Connection.closeRemoteResultSet: Error occured while request was processed by C-JDBC Controller (" 02224 + e + ")"); 02225 } 02226 }
|
|
Makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the
Definition at line 340 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, org.objectweb.cjdbc.driver.Connection.transactionId, and org.objectweb.cjdbc.driver.Connection.writeExecutedInTransaction. 00341 { 00342 if (autoCommit) 00343 throw new SQLException("Trying to commit a connection in autocommit mode"); 00344 00345 if (driver == null) 00346 throw new SQLException("No driver to send the commit request"); 00347 try 00348 { 00349 socketOutput.writeInt(Commands.Commit); 00350 socketOutput.flush(); 00351 // Commit is followed by a BEGIN 00352 Object r = socketInput.readObject(); 00353 writeExecutedInTransaction = false; 00354 if (r instanceof Long) 00355 transactionId = ((Long) r).longValue(); 00356 else 00357 throw new SQLException( 00358 "Error occured while trying to start transaction after commit on C-JDBC Controller (" 00359 + r + ")"); 00360 } 00361 catch (Exception e) 00362 { 00363 throw new SQLException("Error occured while commit of transaction '" 00364 + transactionId + "' was processed by C-JDBC Controller (" + e + ")"); 00365 } 00366 }
|
|
Creates a
This method is the same as the
Definition at line 1803 of file Connection.java. 01805 { 01806 throw new NotImplementedException("createStatement"); 01807 }
|
|
SQL statements without parameters are normally executed using
Definition at line 393 of file Connection.java. References org.objectweb.cjdbc.driver.Statement.setResultSetConcurrency(), and org.objectweb.cjdbc.driver.Statement.setResultSetType(). 00395 { 00396 Statement s = new Statement(this); 00397 s.setResultSetType(resultSetType); 00398 s.setResultSetConcurrency(resultSetConcurrency); 00399 return s; 00400 }
|
|
SQL statements without parameters are normally executed using Definition at line 378 of file Connection.java. 00379 { 00380 return new Statement(this); 00381 }
|
|
Performs a read request and return the reply.
Definition at line 930 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Driver.getControllerConfig(), org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.Statement.executeQuery(). 00932 { 00933 if (driver == null) 00934 throw new SQLException("No driver to send the request '" 00935 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) + "'"); 00936 try 00937 { 00938 setConnectionParametersOnRequest(request); 00939 socketOutput.writeInt(Commands.ExecReadRequest); 00940 readRequestOnStream(request); 00941 socketOutput.flush(); 00942 00943 Object in = socketInput.readObject(); 00944 if (in instanceof NoMoreBackendException) 00945 { 00946 try 00947 { 00948 // If there is only one controller available rethrow the exception 00949 if (driver.getControllerConfig().size() == 1) 00950 throw (SQLException) in; 00951 else 00952 { 00953 // otherwise try to connect to an other controller and re-execute 00954 // the query 00955 reconnect(); 00956 return execReadRequest(request); 00957 } 00958 } 00959 catch (SQLException e1) 00960 { 00961 // We deal with this exception in the follwoing if block 00962 in = e1; 00963 } 00964 } 00965 if (in instanceof IOException) 00966 { 00967 reconnect(); 00968 return execReadRequest(request); 00969 } 00970 else if (in instanceof SQLException) 00971 { 00972 throw (SQLException) in; 00973 } 00974 else if (in instanceof Field[]) 00975 { // Get the ResultSet metadata the row data 00976 Field[] fields = (Field[]) in; 00977 ArrayList data = null; 00978 boolean hasMoreData; 00979 String cursorName = null; 00980 try 00981 { 00982 data = (ArrayList) socketInput.readObject(); 00983 hasMoreData = socketInput.readBoolean(); 00984 if (hasMoreData) 00985 cursorName = socketInput.readUTF(); 00986 } 00987 catch (IOException e) 00988 { 00989 reconnect(); 00990 return execReadRequest(request); 00991 } 00992 catch (Exception e1) 00993 { 00994 throw new SQLException( 00995 "Connection.execReadRequest: Unexpected response (" + e1 00996 + ") for request " 00997 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 00998 } 00999 return new org.objectweb.cjdbc.driver.DriverResultSet(fields, data, 01000 hasMoreData, cursorName); 01001 } 01002 else 01003 { 01004 throw new SQLException( 01005 "Connection.execReadRequest: Unexpected response (" + in 01006 + ") for request " 01007 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01008 } 01009 01010 } 01011 catch (RuntimeException e) 01012 { 01013 e.printStackTrace(); 01014 throw new SQLException( 01015 "Connection.execReadRequest: Error occured while request '" 01016 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01017 + "' was processed by C-JDBC Controller (" + e + ")"); 01018 } 01019 catch (IOException e) 01020 { // Connection failed, try to reconnect and re-exec the query 01021 try 01022 { 01023 reconnect(); 01024 return execReadRequest(request); 01025 } 01026 catch (SQLException e1) 01027 { 01028 throw new SQLException("Connection lost while executing request '" 01029 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01030 + "' and automatic reconnect failed (" + e1 + ")"); 01031 } 01032 } 01033 catch (ClassNotFoundException e) 01034 { 01035 e.printStackTrace(); 01036 throw new SQLException( 01037 "Connection.execReadRequest: Unexpected response (" + e 01038 + ") for request " 01039 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01040 } 01041 }
|
|
Call a stored procedure that returns a ResultSet.
Definition at line 1388 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.common.stream.CJDBCOutputStream.flush(), org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, and org.objectweb.cjdbc.common.stream.CJDBCOutputStream.writeInt(). Referenced by org.objectweb.cjdbc.driver.Statement.executeQuery(). 01390 { 01391 if (driver == null) 01392 throw new SQLException("No driver to send the request '" 01393 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) + "'"); 01394 try 01395 { 01396 setConnectionParametersOnRequest(proc); 01397 socketOutput.writeInt(Commands.ExecReadStoredProcedure); 01398 procedureOnStream(proc, true); 01399 socketOutput.flush(); 01400 01401 Object in = socketInput.readObject(); 01402 if (in instanceof SQLException) 01403 throw (SQLException) in; 01404 else if (in instanceof Field[]) 01405 { // Get the ResultSet metadata the row data 01406 Field[] fields = (Field[]) in; 01407 ArrayList data = null; 01408 boolean hasMoreData; 01409 String cursorName = null; 01410 try 01411 { 01412 data = (ArrayList) socketInput.readObject(); 01413 hasMoreData = socketInput.readBoolean(); 01414 if (hasMoreData) 01415 cursorName = socketInput.readUTF(); 01416 } 01417 catch (Exception e1) 01418 { 01419 throw new SQLException( 01420 "Connection.execReadStoredProcedure: Unexpected response (" + e1 01421 + ") for request " 01422 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01423 } 01424 return new org.objectweb.cjdbc.driver.DriverResultSet(fields, data, 01425 hasMoreData, cursorName); 01426 } 01427 else 01428 throw new SQLException( 01429 "Connection.execReadStoredProcedure: Unexpected response (" + in 01430 + ") for request " 01431 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01432 } 01433 catch (RuntimeException e) 01434 { 01435 throw new SQLException( 01436 "Connection.execReadStoredProcedure: Error occured while request '" 01437 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01438 + "' was processed by C-JDBC Controller (" + e + ")"); 01439 } 01440 catch (IOException e) 01441 { // Connection failed, try to reconnect and re-exec the query 01442 try 01443 { 01444 reconnect(); 01445 return execReadStoredProcedure(proc); 01446 } 01447 catch (SQLException e1) 01448 { 01449 throw new SQLException("Connection lost while executing request'" 01450 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01451 + "' and automatic reconnect failed (" + e1 + ")"); 01452 } 01453 } 01454 catch (ClassNotFoundException e) 01455 { 01456 throw new SQLException( 01457 "Connection.execReadStoredProcedure: Unexpected response (" + e 01458 + ") for request " 01459 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01460 } 01461 }
|
|
Performs a write request and return the number of rows affected.
Definition at line 1121 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.Statement.executeUpdateWithSkeleton(). 01123 { 01124 if (driver == null) 01125 throw new SQLException("No driver to send the request '" 01126 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) + "'"); 01127 try 01128 { 01129 setConnectionParametersOnRequest(request); 01130 socketOutput.writeInt(Commands.ExecWriteRequest); 01131 writeRequestOnStream(request, false); 01132 socketOutput.flush(); 01133 01134 Object r = socketInput.readObject(); 01135 if (r instanceof Integer) 01136 return ((Integer) r).intValue(); 01137 else if (r instanceof SQLException) 01138 throw (SQLException) r; 01139 else 01140 throw new SQLException( 01141 "Connection.execWriteRequest: Unexpected response (" + r 01142 + ") for request " 01143 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01144 } 01145 catch (SQLException e) 01146 { 01147 throw e; 01148 } 01149 catch (IOException e) 01150 { // Connection failed, try to reconnect and re-exec the query 01151 try 01152 { 01153 reconnect(); 01154 return execWriteRequest(request); 01155 } 01156 catch (SQLException e1) 01157 { 01158 throw new SQLException("Connection lost while executing request'" 01159 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01160 + "' and automatic reconnect failed (" + e1 + ")"); 01161 } 01162 } 01163 catch (Exception e) 01164 { 01165 throw new SQLException("execWriteRequest: Error occured while request '" 01166 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01167 + "' was processed by C-JDBC Controller (" + e + ")"); 01168 } 01169 }
|
|
Performs a write request and return the number of rows affected.
Definition at line 1327 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.common.stream.CJDBCOutputStream.flush(), org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, and org.objectweb.cjdbc.common.stream.CJDBCOutputStream.writeInt(). Referenced by org.objectweb.cjdbc.driver.Statement.executeUpdateWithSkeleton(). 01329 { 01330 if (driver == null) 01331 throw new SQLException("No driver to send the request '" 01332 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) + "'"); 01333 try 01334 { 01335 setConnectionParametersOnRequest(request); 01336 socketOutput.writeInt(Commands.ExecWriteRequestWithKeys); 01337 writeRequestOnStream(request, true); 01338 socketOutput.flush(); 01339 01340 Object in = socketInput.readObject(); 01341 if (in instanceof SQLException) 01342 throw (SQLException) in; 01343 else if (in instanceof Field[]) 01344 { // Get the ResultSet metadata the row data 01345 Field[] fields = (Field[]) in; 01346 ArrayList data = null; 01347 boolean hasMoreData; 01348 String cursorName = null; 01349 try 01350 { 01351 data = (ArrayList) socketInput.readObject(); 01352 hasMoreData = socketInput.readBoolean(); 01353 if (hasMoreData) 01354 cursorName = socketInput.readUTF(); 01355 } 01356 catch (Exception e1) 01357 { 01358 throw new SQLException( 01359 "Connection.execWriteRequestWithKeys: Unexpected response (" + e1 01360 + ") for request " 01361 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01362 } 01363 return new org.objectweb.cjdbc.driver.DriverResultSet(fields, data, 01364 hasMoreData, cursorName); 01365 } 01366 else 01367 throw new SQLException( 01368 "Connection.execWriteRequestWithKeys: Unexpected response (" + in 01369 + ") for request " 01370 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01371 } 01372 catch (Exception e) 01373 { 01374 throw new SQLException( 01375 "execWriteRequestWithKeys: Error occured while request '" 01376 + request.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01377 + "' was processed by C-JDBC Controller (" + e + ")"); 01378 } 01379 }
|
|
Call a stored procedure that performs an update.
Definition at line 1470 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.common.stream.CJDBCOutputStream.flush(), org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, and org.objectweb.cjdbc.common.stream.CJDBCOutputStream.writeInt(). Referenced by org.objectweb.cjdbc.driver.Statement.executeUpdateWithSkeleton(). 01472 { 01473 if (driver == null) 01474 throw new SQLException("No driver to send the request '" 01475 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) + "'"); 01476 try 01477 { 01478 setConnectionParametersOnRequest(proc); 01479 socketOutput.writeInt(Commands.ExecWriteStoredProcedure); 01480 procedureOnStream(proc, false); 01481 socketOutput.flush(); 01482 01483 Object r = socketInput.readObject(); 01484 if (r instanceof Integer) 01485 return ((Integer) r).intValue(); 01486 else if (r instanceof SQLException) 01487 throw (SQLException) r; 01488 else 01489 throw new SQLException( 01490 "Connection.execWriteStoredProcedure: Unexpected response (" + r 01491 + ") for request " 01492 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH)); 01493 } 01494 catch (Exception e) 01495 { 01496 throw new SQLException( 01497 "execWriteStoredProcedure: Error occured while request '" 01498 + proc.getSQLShortForm(Constants.SQL_SHORT_FORM_LENGTH) 01499 + "' was processed by C-JDBC Controller (" + e + ")"); 01500 } 01501 }
|
|
Fetch next fetchSize rows of data and update the given ResultSet.
Definition at line 2165 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DriverResultSet.next(). 02167 { 02168 try 02169 { 02170 socketOutput.writeInt(Commands.FetchNextResultSetRows); 02171 socketOutput.writeUTF(cursorName); 02172 socketOutput.writeInt(fetchSize); 02173 socketOutput.flush(); 02174 02175 Object data = socketInput.readObject(); 02176 if (data instanceof ArrayList) 02177 { 02178 boolean hasMoreData = socketInput.readBoolean(); 02179 drsToUpdate.setData((ArrayList) data); 02180 drsToUpdate.setHasMoreData(hasMoreData); 02181 } 02182 else if (data instanceof SQLException) 02183 throw (SQLException) data; 02184 else 02185 throw new SQLException( 02186 "Connection.fetchNextData: Unexpected response (" + data + ")"); 02187 } 02188 catch (Exception e) 02189 { 02190 throw new SQLException( 02191 "Connection.fetchNextData: Error occured while request was processed by C-JDBC Controller (" 02192 + e + ")"); 02193 } 02194 }
|
|
Definition at line 195 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.close(), and org.objectweb.cjdbc.driver.Connection.rollback(). 00196 { 00197 if (this.closeSocketOnGC) 00198 { 00199 Throwable t = null; 00200 try 00201 { 00202 rollback(); 00203 } 00204 catch (Exception e) 00205 { 00206 t = e; 00207 } 00208 try 00209 { 00210 close(); 00211 } 00212 catch (Exception e) 00213 { 00214 t = e; 00215 } 00216 00217 if (t != null) 00218 { 00219 throw t; 00220 } 00221 00222 } 00223 super.finalize(); 00224 }
|
|
Gets the current auto-commit state.
Definition at line 409 of file Connection.java. 00410 { 00411 return this.autoCommit; 00412 }
|
|
Returns the blobFilter value.
Definition at line 2009 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.DriverResultSet.getBytes(), org.objectweb.cjdbc.driver.DriverResultSet.getObject(), and org.objectweb.cjdbc.driver.PreparedStatement.setBytes(). 02010 { 02011 if (blobFilter == null) 02012 blobFilter = new HexaBlobFilter(); 02013 return blobFilter; 02014 }
|
|
Return current catalog name.
Definition at line 439 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. 00440 { 00441 if (driver == null) 00442 throw new SQLException("No driver to get the catalog."); 00443 try 00444 { 00445 socketOutput.writeInt(Commands.ConnectionGetCatalog); 00446 socketOutput.flush(); 00447 00448 Object rs = socketInput.readObject(); 00449 if (rs instanceof String) 00450 { 00451 return (String) rs; 00452 } 00453 else if (rs instanceof SQLException) 00454 throw (SQLException) rs; 00455 else 00456 throw new SQLException("Connection.getCatalog: Unexpected response (" 00457 + rs + ")"); 00458 } 00459 catch (Exception e) 00460 { 00461 throw new SQLException( 00462 "Connection.getCatalog: Error occured while request was processed by C-JDBC Controller (" 00463 + e + ")"); 00464 } 00465 }
|
|
getCatalogs definition.
Definition at line 473 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getCatalogs(). 00474 { 00475 00476 if (driver == null) 00477 throw new SQLException("No driver to get the catalogs."); 00478 try 00479 { 00480 socketOutput.writeInt(Commands.ConnectionGetCatalogs); 00481 socketOutput.flush(); 00482 00483 Object rs = socketInput.readObject(); 00484 if (rs instanceof ResultSet) 00485 return (ResultSet) rs; 00486 else if (rs instanceof SQLException) 00487 throw (SQLException) rs; 00488 else 00489 throw new SQLException("Connection.getCatalogs: Unexpected response (" 00490 + rs + ")"); 00491 } 00492 catch (Exception e) 00493 { 00494 throw new SQLException( 00495 "Connection.getCatalogs: Error occured while request was processed by C-JDBC Controller (" 00496 + e + ")"); 00497 } 00498 }
|
|
Get the controller description to which this connection is connected to
Definition at line 262 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.socket. 00263 { 00264 if (socket == null) 00265 return null; 00266 else 00267 return socket.getInetAddress().getHostName() + ":" + socket.getPort(); 00268 }
|
|
Get the C-JDBC controller version number.
Definition at line 1645 of file Connection.java. References org.objectweb.cjdbc.common.stream.CJDBCInputStream.readObject(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getDatabaseProductVersion(). 01646 { 01647 try 01648 { 01649 socketOutput.writeInt(Commands.GetControllerVersionNumber); 01650 socketOutput.flush(); 01651 01652 Object s = socketInput.readObject(); 01653 if (s instanceof String) 01654 return (String) s; 01655 else 01656 throw new SQLException( 01657 "Connection.getControllerVersionNumber: Unexpected response (" + s 01658 + ")"); 01659 } 01660 catch (Exception e) 01661 { 01662 throw new SQLException( 01663 "Connection.getControllerVersionNumber: Error occured while request was processed by C-JDBC Controller (" 01664 + e + ")"); 01665 } 01666 }
|
|
Definition at line 2134 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getDatabaseProductName(). 02135 { 02136 try 02137 { 02138 socketOutput.writeInt(Commands.DatabaseMetaDataGetDatabaseProductName); 02139 socketOutput.flush(); 02140 02141 Object s = socketInput.readObject(); 02142 if (s instanceof String) 02143 return (String) s; 02144 else 02145 throw new SQLException( 02146 "Connection.GetDatabaseProductName: Unexpected response (" + s 02147 + ")"); 02148 } 02149 catch (Exception e) 02150 { 02151 throw new SQLException( 02152 "Connection.getDatabaseProductName: Error occured while request was processed by C-JDBC Controller (" 02153 + e + ")"); 02154 } 02155 }
|
|
Definition at line 2342 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.PreparedStatement.doEscapeProcessing(). 02343 {
02344 return escapeChar;
02345 }
|
|
Retrieves the current holdability of
Definition at line 1701 of file Connection.java. 01702 { 01703 throw new NotImplementedException("getHoldability"); 01704 }
|
|
A connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is made available through a DatabaseMetaData object.
Definition at line 423 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.metaData. 00424 { 00425 if (metaData == null) 00426 { 00427 metaData = new DatabaseMetaData(this); 00428 } 00429 return metaData; 00430 }
|
|
Gets the password used to login to the database.
Definition at line 251 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Driver.connect(). 00252 {
00253 return vdbPassword;
00254 }
|
|
Returns the booleanFalse value.
Definition at line 2233 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), and org.objectweb.cjdbc.driver.PreparedStatement.setBoolean(). 02234 {
02235 return preparedStatementBooleanFalse;
02236 }
|
|
Returns the booleanTrue value.
Definition at line 2253 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.DriverResultSet.getBoolean(), and org.objectweb.cjdbc.driver.PreparedStatement.setBoolean(). 02254 {
02255 return preparedStatementBooleanTrue;
02256 }
|
|
Definition at line 1539 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.common.stream.CJDBCInputStream.readObject(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getPrimaryKeys(). 01541 { 01542 if (driver == null) 01543 throw new SQLException("No driver to get the tables."); 01544 try 01545 { 01546 socketOutput.writeInt(Commands.DatabaseMetaDataGetPrimaryKeys); 01547 socketOutput.writeUTF(catalog); 01548 socketOutput.writeUTF(schemaPattern); 01549 socketOutput.writeUTF(tableNamePattern); 01550 socketOutput.flush(); 01551 01552 Object rs = socketInput.readObject(); 01553 if (rs == null) 01554 return null; 01555 if (rs instanceof ResultSet) 01556 return (ResultSet) rs; 01557 else if (rs instanceof SQLException) 01558 throw (SQLException) rs; 01559 else 01560 throw new SQLException( 01561 "Connection.getPrimaryKeys: Unexpected response (" + rs + ")"); 01562 } 01563 catch (Exception e) 01564 { 01565 throw new SQLException( 01566 "Connection.getPrimaryKeys: Error occured while request was processed by C-JDBC Controller (" 01567 + e + ")"); 01568 } 01569 }
|
|
Definition at line 2103 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getSchemas(). 02104 { 02105 if (driver == null) 02106 throw new SQLException("No driver to get the schemas."); 02107 try 02108 { 02109 socketOutput.writeInt(Commands.DatabaseMetaDataGetSchemas); 02110 socketOutput.flush(); 02111 02112 Object rs = socketInput.readObject(); 02113 if (rs == null) 02114 return null; 02115 if (rs instanceof ResultSet) 02116 return (ResultSet) rs; 02117 else if (rs instanceof SQLException) 02118 throw (SQLException) rs; 02119 else 02120 throw new SQLException("Connection.getSchemas: Unexpected response (" 02121 + rs + ")"); 02122 } 02123 catch (Exception e) 02124 { 02125 throw new SQLException( 02126 "Connection.getSchemas: Error occured while request was processed by C-JDBC Controller (" 02127 + e + ")"); 02128 } 02129 }
|
|
Retrieve a metadata from the controller
Definition at line 1616 of file Connection.java. References org.objectweb.cjdbc.common.stream.CJDBCInputStream.readObject(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. 01617 { 01618 try 01619 { 01620 socketOutput.writeInt(Commands.DatabaseStaticMetadata); 01621 socketOutput.writeUTF(key); 01622 socketOutput.flush(); 01623 01624 Object s = socketInput.readObject(); 01625 if (s instanceof SQLException) 01626 throw (SQLException) s; 01627 else 01628 return s; 01629 } 01630 catch (Exception e) 01631 { 01632 throw new SQLException( 01633 "Connection.getStaticMetadata: Error occured while request was processed by C-JDBC Controller (" 01634 + e + ")"); 01635 } 01636 01637 }
|
|
Gets a description of the access rights for each table available in a catalog. Note that a table privilege applies to one or more columns in the table. It would be wrong to assume that this priviledge applies to all columns (this may be true for some systems but is not true for all.) Only privileges matching the schema and table name criteria are returned. They are ordered by TABLE_SCHEM, TABLE_NAME, and PRIVILEGE.
Definition at line 2068 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getTablePrivileges(). 02070 { 02071 if (driver == null) 02072 throw new SQLException("No driver to get the table privileges."); 02073 try 02074 { 02075 socketOutput.writeInt(Commands.DatabaseMetaDataGetTablePrivileges); 02076 socketOutput.writeUTF(catalog); 02077 socketOutput.writeUTF(schemaPattern); 02078 socketOutput.writeUTF(tableNamePattern); 02079 socketOutput.flush(); 02080 02081 Object rs = socketInput.readObject(); 02082 if (rs == null) 02083 return null; 02084 if (rs instanceof ResultSet) 02085 return (ResultSet) rs; 02086 else if (rs instanceof SQLException) 02087 throw (SQLException) rs; 02088 else 02089 throw new SQLException( 02090 "Connection.getTablePrivileges: Unexpected response (" + rs + ")"); 02091 } 02092 catch (Exception e) 02093 { 02094 throw new SQLException( 02095 "Connection.getTablePrivileges: Error occured while request was processed by C-JDBC Controller (" 02096 + e + ")"); 02097 } 02098 }
|
|
Definition at line 1575 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.common.stream.CJDBCInputStream.readObject(), org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getTables(). 01577 { 01578 if (driver == null) 01579 throw new SQLException("No driver to get the tables."); 01580 try 01581 { 01582 socketOutput.writeInt(Commands.DatabaseMetaDataGetTables); 01583 socketOutput.writeUTF(catalog); 01584 socketOutput.writeUTF(schemaPattern); 01585 socketOutput.writeUTF(tableNamePattern); 01586 socketOutput.writeObject(types); 01587 socketOutput.flush(); 01588 01589 Object rs = socketInput.readObject(); 01590 if (rs == null) 01591 return null; 01592 if (rs instanceof ResultSet) 01593 return (ResultSet) rs; 01594 else if (rs instanceof SQLException) 01595 throw (SQLException) rs; 01596 else 01597 throw new SQLException("Connection.getTables: Unexpected response (" 01598 + rs + ")"); 01599 } 01600 catch (Exception e) 01601 { 01602 throw new SQLException( 01603 "Connection.getTables: Error occured while request was processed by C-JDBC Controller (" 01604 + e + ")"); 01605 } 01606 }
|
|
Gets the table types available in this database. The results are ordered by table type.
Definition at line 2024 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, and org.objectweb.cjdbc.driver.Connection.socketOutput. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.getTableTypes(). 02025 { 02026 if (driver == null) 02027 throw new SQLException("No driver to get the table types."); 02028 try 02029 { 02030 socketOutput.writeInt(Commands.DatabaseMetaDataGetTableTypes); 02031 socketOutput.flush(); 02032 02033 Object rs = socketInput.readObject(); 02034 if (rs == null) 02035 return null; 02036 if (rs instanceof ResultSet) 02037 return (ResultSet) rs; 02038 else if (rs instanceof SQLException) 02039 throw (SQLException) rs; 02040 else 02041 throw new SQLException( 02042 "Connection.getTableTypes: Unexpected response (" + rs + ")"); 02043 } 02044 catch (Exception e) 02045 { 02046 throw new SQLException( 02047 "Connection.getTableTypes: Error occured while request was processed by C-JDBC Controller (" 02048 + e + ")"); 02049 } 02050 }
|
|
Gets this Connection's current transaction isolation mode.
Definition at line 568 of file Connection.java. 00569 {
00570 return isolationLevel;
00571 }
|
|
C-JDBC does NOT support type map.
Definition at line 579 of file Connection.java. 00580 { 00581 throw new NotImplementedException("getTypeMap()"); 00582 }
|
|
Gets the C-JDBC URL of the database of the connection.
Definition at line 231 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Driver.connect(), and org.objectweb.cjdbc.driver.DatabaseMetaData.getURL(). 00232 {
00233 return url;
00234 }
|
|
Gets the user name used to login to the database.
Definition at line 241 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Driver.connect(), and org.objectweb.cjdbc.driver.DatabaseMetaData.getUserName(). 00242 {
00243 return vdbUser;
00244 }
|
|
The first warning reported by calls on this connection is returned. Note: Sebsequent warnings will be changed to this SQLWarning
Definition at line 591 of file Connection.java. 00592 {
00593 return firstWarning;
00594 }
|
|
Returns
Definition at line 604 of file Connection.java. 00605 {
00606 return isClosed;
00607 }
|
|
|
Returns the escapeBackslash value.
Definition at line 2273 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.PreparedStatement.doEscapeProcessing(), and org.objectweb.cjdbc.driver.PreparedStatement.setString(). 02274 {
02275 return escapeBackslash;
02276 }
|
|
Returns the escapeSingleQuote value.
Definition at line 2293 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.PreparedStatement.doEscapeProcessing(), and org.objectweb.cjdbc.driver.PreparedStatement.setString(). 02294 {
02295 return escapeSingleQuote;
02296 }
|
|
Tests to see if the connection is in read only Mode. Note that we cannot really put the database in read only mode, but we pretend we can by returning the value of the
Definition at line 617 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.DatabaseMetaData.isReadOnly(). 00618 {
00619 return readOnly;
00620 }
|
|
As we can't know for sure which database will execute this request (now or later), we can't translate it in the native query language of the underlying DBMS. Therefore the query is returned unchanged.
Definition at line 631 of file Connection.java. 00632 {
00633 return query;
00634 }
|
|
Creates a
Definition at line 1876 of file Connection.java. 01878 { 01879 throw new NotImplementedException("prepareCall"); 01880 }
|
|
Stored procedure call are not yet supported by C-JDBC.
Definition at line 659 of file Connection.java. References org.objectweb.cjdbc.driver.Statement.setResultSetConcurrency(), and org.objectweb.cjdbc.driver.Statement.setResultSetType(). 00661 { 00662 CallableStatement c = new CallableStatement(this, sql); 00663 c.setResultSetType(resultSetType); 00664 c.setResultSetConcurrency(resultSetConcurrency); 00665 return c; 00666 }
|
|
Creates a CallableStatement that contains sql and produces a ResultSet that is TYPE_SCROLL_INSENSITIVE and CONCUR_READ_ONLY.
Definition at line 644 of file Connection.java. 00645 { 00646 return prepareCall(sql, java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE, 00647 java.sql.ResultSet.CONCUR_READ_ONLY); 00648 }
|
|
Creates a default
An SQL statement with or without IN parameters can be pre-compiled and stored in a
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method
Result sets created using the returned
Definition at line 1998 of file Connection.java. 02000 { 02001 throw new NotImplementedException("prepareStatement"); 02002 }
|
|
Creates a default
An SQL statement with or without IN parameters can be pre-compiled and stored in a
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method
Result sets created using the returned
Definition at line 1958 of file Connection.java. 01960 { 01961 throw new NotImplementedException("prepareStatement"); 01962 }
|
|
Creates a default
Note: This method is optimized for handling parametric SQL statements that benefit from precompilation. If the driver supports precompilation, the method
Result sets created using the returned
Definition at line 1916 of file Connection.java. References org.objectweb.cjdbc.driver.PreparedStatement.setGeneratedKeysFlag(). 01918 { 01919 PreparedStatement ps = new PreparedStatement(this, sql); 01920 ps.setGeneratedKeysFlag(autoGeneratedKeys); 01921 return ps; 01922 }
|
|
Creates a
This method is the same as the
Definition at line 1840 of file Connection.java. 01843 { 01844 throw new NotImplementedException("prepareStatement"); 01845 }
|
|
A SQL statement with or without IN parameters can be pre-compiled and stored in a
Definition at line 696 of file Connection.java. References org.objectweb.cjdbc.driver.Statement.setResultSetConcurrency(), and org.objectweb.cjdbc.driver.Statement.setResultSetType(). 00698 { 00699 PreparedStatement s = new PreparedStatement(this, sql); 00700 s.setResultSetType(resultSetType); 00701 s.setResultSetConcurrency(resultSetConcurrency); 00702 return s; 00703 }
|
|
A SQL statement with or without
Definition at line 679 of file Connection.java. 00681 { 00682 return new PreparedStatement(this, sql); 00683 }
|
|
Removes the given
Definition at line 1770 of file Connection.java. 01771 { 01772 throw new NotImplementedException("releaseSavepoint"); 01773 }
|
|
Undoes all changes made after the given This method should be used only when auto-commit has been disabled.
Definition at line 1754 of file Connection.java. 01755 { 01756 throw new NotImplementedException("rollback"); 01757 }
|
|
Drops all changes made since the previous commit/rollback and releases any database locks currently held by this connection. If the connection was in autocommit mode, we throw a SQLException.
Definition at line 714 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, org.objectweb.cjdbc.driver.Connection.transactionId, and org.objectweb.cjdbc.driver.Connection.writeExecutedInTransaction. Referenced by org.objectweb.cjdbc.driver.Connection.finalize(). 00715 { 00716 if (autoCommit) 00717 throw new SQLException( 00718 "Trying to rollback a connection in autocommit mode"); 00719 00720 if (driver == null) 00721 throw new SQLException("No driver to send the rollback request"); 00722 00723 try 00724 { 00725 socketOutput.writeInt(Commands.Rollback); 00726 socketOutput.flush(); 00727 // Rollback is followed by a BEGIN 00728 writeExecutedInTransaction = false; 00729 Object r = socketInput.readObject(); 00730 if (r instanceof Long) 00731 transactionId = ((Long) r).longValue(); 00732 else 00733 throw new SQLException( 00734 "Error occured while trying to start transaction after rollback on C-JDBC Controller (" 00735 + r + ")"); 00736 } 00737 catch (Exception e) 00738 { 00739 throw new SQLException("Error occured while rollback of transaction '" 00740 + transactionId + "' was processed by C-JDBC Controller (" + e + ")"); 00741 } 00742 }
|
|
If a connection is in auto-commit mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, its SQL statements are grouped into transactions that are terminated by either commit()or rollback(). By default, new connections are in auto-commit mode. The commit occurs when the statement completes or the next execute occurs, whichever comes first. In the case of statements returning a
Definition at line 762 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, org.objectweb.cjdbc.driver.Connection.transactionId, and org.objectweb.cjdbc.driver.Connection.writeExecutedInTransaction. 00763 { 00764 if (this.autoCommit == autoCommit) 00765 return; 00766 00767 this.autoCommit = autoCommit; 00768 if (driver == null) 00769 throw new SQLException("No driver to get a transaction id"); 00770 00771 if (autoCommit) 00772 { 00773 transactionId = 0; 00774 try 00775 { 00776 socketOutput.writeInt(Commands.SetAutoCommit); 00777 socketOutput.flush(); 00778 Object r = socketInput.readObject(); 00779 writeExecutedInTransaction = false; 00780 if (r instanceof Boolean || ((Boolean) r).booleanValue()) 00781 return; 00782 else 00783 throw new SQLException( 00784 "Error occured while trying to change autocommit value on C-JDBC Controller (" 00785 + r + ")"); 00786 } 00787 catch (Exception e) 00788 { 00789 throw new SQLException( 00790 "Error occured while trying to change autocommit value on C-JDBC Controller (" 00791 + e + ")"); 00792 } 00793 } 00794 else 00795 { 00796 00797 try 00798 { 00799 socketOutput.writeInt(Commands.Begin); 00800 socketOutput.flush(); 00801 Object r = socketInput.readObject(); 00802 if (r instanceof Long) 00803 transactionId = ((Long) r).longValue(); 00804 else 00805 throw new SQLException( 00806 "Error occured while trying to start transaction on C-JDBC Controller (" 00807 + r + ")"); 00808 this.autoCommit = false; 00809 } 00810 catch (Exception e) 00811 { 00812 throw new SQLException( 00813 "Error occured while trying to start transaction on C-JDBC Controller (" 00814 + e + ")"); 00815 } 00816 } 00817 }
|
|
Change the current catalog
Definition at line 825 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.driver, org.objectweb.cjdbc.driver.Driver.getUrlFromProperties(), org.objectweb.cjdbc.driver.Driver.parseURL(), org.objectweb.cjdbc.driver.Connection.socketInput, org.objectweb.cjdbc.driver.Connection.socketOutput, and org.objectweb.cjdbc.driver.Connection.url. 00826 { 00827 if (catalog == null) 00828 throw new SQLException("Invalid Catalog"); 00829 Hashtable properties = driver.parseURL(url); 00830 properties.put(Driver.DATABASE_PROPERTY, catalog); 00831 url = driver.getUrlFromProperties(properties); 00832 00833 if (driver == null) 00834 throw new SQLException("No driver to set the catalog."); 00835 try 00836 { 00837 socketOutput.writeInt(Commands.ConnectionSetCatalog); 00838 socketOutput.writeUTF(catalog); 00839 socketOutput.flush(); 00840 00841 Object rs = socketInput.readObject(); 00842 if (rs instanceof Boolean) 00843 { 00844 if (((Boolean) rs).booleanValue() == false) 00845 throw new SQLException("Invalid Catalog"); 00846 } 00847 else 00848 throw new SQLException("Connection.setCatalog: Unexpected response (" 00849 + rs + ")"); 00850 } 00851 catch (Exception e) 00852 { 00853 throw new SQLException( 00854 "Connection.setCatalog: Error occured while request was processed by C-JDBC Controller (" 00855 + e + ")"); 00856 } 00857 }
|
|
Sets the closeSocketOnGC value.
Definition at line 1109 of file Connection.java. 01110 {
01111 this.closeSocketOnGC = closeSocketOnGC;
01112 }
|
|
Set the autocommit mode and read-only status on this request.
Definition at line 916 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.autoCommit, org.objectweb.cjdbc.driver.Connection.readOnly, org.objectweb.cjdbc.common.sql.AbstractRequest.setDriverProcessed(), org.objectweb.cjdbc.common.sql.AbstractRequest.setIsAutoCommit(), and org.objectweb.cjdbc.common.sql.AbstractRequest.setIsReadOnly(). Referenced by org.objectweb.cjdbc.driver.Connection.execReadRequest(), org.objectweb.cjdbc.driver.Connection.execReadStoredProcedure(), org.objectweb.cjdbc.driver.Connection.execWriteRequest(), org.objectweb.cjdbc.driver.Connection.execWriteRequestWithKeys(), and org.objectweb.cjdbc.driver.Connection.execWriteStoredProcedure(). 00917 { 00918 request.setIsAutoCommit(autoCommit); 00919 request.setIsReadOnly(readOnly); 00920 request.setDriverProcessed(driverProcessed); 00921 }
|
|
Sets the driverProcessed value
Definition at line 2314 of file Connection.java. 02315 {
02316 this.driverProcessed = processedByDriver;
02317 }
|
|
Sets the escapeBackslash value.
Definition at line 2283 of file Connection.java. 02284 {
02285 this.escapeBackslash = escapeBackslash;
02286 }
|
|
Sets the escapeCharacter value
Definition at line 2334 of file Connection.java. 02335 {
02336 this.escapeChar = escapeChar;
02337 }
|
|
Sets the escapeSingleQuote value.
Definition at line 2303 of file Connection.java. 02304 {
02305 this.escapeSingleQuote = escapeSingleQuote;
02306 }
|
|
Changes the holdability of
Definition at line 1684 of file Connection.java. 01685 { 01686 throw new NotImplementedException("setHoldability"); 01687 }
|
|
Sets the booleanFalse value.
Definition at line 2243 of file Connection.java. 02244 {
02245 this.preparedStatementBooleanFalse = booleanFalse;
02246 }
|
|
Sets the booleanTrue value.
Definition at line 2263 of file Connection.java. 02264 {
02265 this.preparedStatementBooleanTrue = booleanTrue;
02266 }
|
|
You can put a connection in read-only mode as a hint to enable database optimizations Note: setReadOnly cannot be called while in the middle of a transaction with write requests.
Definition at line 870 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.autoCommit. 00871 { 00872 if ((autoCommit == false) && writeExecutedInTransaction) 00873 throw new SQLException( 00874 "setReadOnly cannot be called in a transaction that has executed write requests."); 00875 00876 this.readOnly = readOnly; 00877 }
|
|
Creates a savepoint with the given name in the current transaction and returns the new
Definition at line 1734 of file Connection.java. 01735 { 01736 throw new NotImplementedException("setSavepoint"); 01737 }
|
|
Creates an unnamed savepoint in the current transaction and returns the new
Definition at line 1717 of file Connection.java. 01718 { 01719 throw new NotImplementedException("setSavepoint"); 01720 }
|
|
You can call this method to try to change the transaction isolation level using one of the TRANSACTION_* values. Note: this method cannot be called while in the middle of a transaction.
Definition at line 891 of file Connection.java. References org.objectweb.cjdbc.driver.Connection.isolationLevel. 00892 { 00893 isolationLevel = level; 00894 }
|
|
C-JDBC does NOT support type map.
Definition at line 902 of file Connection.java. 00903 { 00904 throw new NotImplementedException("setTypeMap()"); 00905 }
|
|
Commit mode of the connection ( Definition at line 72 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.close(), org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(), and org.objectweb.cjdbc.driver.Connection.setReadOnly(). |
|
|
Tag for PreparedStatement parameters end delimiter Definition at line 138 of file Connection.java. |
|
List of Definition at line 93 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.clearWarnings(). |
|
Status of the connection. Definition at line 75 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.close(), and org.objectweb.cjdbc.driver.Driver.connect(). |
|
Isolation level. Definition at line 84 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.setTransactionIsolation(). |
|
Initial value: System
.getProperty("line.separator")
Definition at line 146 of file Connection.java. |
|
Meta-data of C-JDBC connections. Definition at line 96 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.getMetaData(). |
|
Does the controller require the SQL skeleton? Definition at line 90 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Statement.executeQuery(), and org.objectweb.cjdbc.driver.Statement.executeUpdateWithSkeleton(). |
|
Is the connection in read-only mode ? Definition at line 78 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.close(), and org.objectweb.cjdbc.driver.Connection.setConnectionParametersOnRequest(). |
|
Connection with the controller. Definition at line 109 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.getConnectedController(). |
|
|
|
Tag for PreparedStatement parameters start delimiter Definition at line 136 of file Connection.java. |
|
Tag maker for PreparedStatement parameters Definition at line 132 of file Connection.java. |
|
Escape for tag maker Definition at line 134 of file Connection.java. |
|
transaction identifier. Definition at line 87 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.commit(), org.objectweb.cjdbc.driver.Connection.rollback(), and org.objectweb.cjdbc.driver.Connection.setAutoCommit(). |
|
C-JDBC URL of the database. Definition at line 102 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.setCatalog(). |
|
Virtual database user used for this connection. Definition at line 105 of file Connection.java. |
|
Has a write request been executed in the current transaction? Definition at line 81 of file Connection.java. Referenced by org.objectweb.cjdbc.driver.Connection.commit(), org.objectweb.cjdbc.driver.Connection.rollback(), and org.objectweb.cjdbc.driver.Connection.setAutoCommit(). |