rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
ParameterNode unnamedParameter = (ParameterNode) SQLValue; if ( unnamedParameter.getTypeServices() == null )
if ( SQLValue.getTypeServices() == null )
public JavaValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { boolean nullParameter = false; String[] parmTypeNames; /* NULL and ? not allowed as receivers */ if (receiver instanceof SQLToJavaValueNode) { ValueNode SQLValue = ((...
lastPage + " > lastPreallocPage " + lastPreallocPage);
lastPage + " > lastPreallocPage " + lastPreallocPage); }
protected BasePage newPage(BaseContainerHandle userHandle, RawTransaction ntt, BaseContainerHandle allocHandle, boolean isOverflow) throws StandardException { // NOTE: right now, we are single threaded thru this method, see MT comment boolean useNTT = (ntt != null); // if ntt is null,...
SanityManager.DEBUG_PRINT("OnlineCompress", "index_col_map = " + index_col_map);
private static void defragmentRows( String schemaName, String tableName, DataDictionary data_dictionary, TransactionController tc) throws SQLException { GroupFetchScanController base_group_fetch_cc = null; int num_index...
SanityManager.DEBUG_PRINT("OnlineCompress", "calling fixIndex, row = " + row + "; index = " + index); SanityManager.DEBUG_PRINT("OnlineCompress", "before fixIndex call index_col_map = " + index_col_map); SanityManager.DEBUG_PRINT("OnlineCompress", "before fixIndex call index_col_map[0] = " + index_col_map[0]);
private static void defragmentRows( String schemaName, String tableName, DataDictionary data_dictionary, TransactionController tc) throws SQLException { GroupFetchScanController base_group_fetch_cc = null; int num_index...
SanityManager.DEBUG_PRINT("OnlineCompress", "setup loop: " + cd_idx);
private static void setup_indexes( TransactionController tc, TableDescriptor td, int[][] index_col_map, ScanController[] index_scan, ConglomerateController[] index_cc, DataValueDescriptor[][] index_row) throws StandardException { /...
SanityManager.DEBUG_PRINT("OnlineCompress", "setup loop 1: " + cd_idx);
private static void setup_indexes( TransactionController tc, TableDescriptor td, int[][] index_col_map, ScanController[] index_scan, ConglomerateController[] index_cc, DataValueDescriptor[][] index_row) throws StandardException { /...
TestOfGetAsciiStream.executeTestOfGetAsciiStream(con);
public static void main(String[] args) { Connection con; ResultSetMetaData met; ResultSet rs; Statement stmt; System.out.println("Test resultsetStream starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); st...
System.out.println("This is a bug. Connection's holdability should have been CLOSE_CURSORS_AT_COMMIT since it is in the global transaction"); System.out.println("Have reported this on Derby dev-list");
private void checkXAHoldability() { System.out.println("START XA HOLDABILITY TEST"); try { EmbeddedXADataSource dscsx = new EmbeddedXADataSource(); dscsx.setDatabaseName("wombat"); XAConnection xac = dscsx.getXAConnection("fred", "wilma"); XAResource xr = xac.getXAResource(); Xid xid = getXid(25, (byte) 21...
getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true",null),"T1:"); getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=max"),"T2:"); getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=neelima;password=lee"),"T3:");
protected void runTest() { // Test cases with get connection via drivermanager and using // different security mechanisms. // Network server supports SECMEC_USRIDPWD, SECMEC_USRIDONL,SECMEC_EUSRIDPWD System.out.println("Checking security mechanism authentication with DriverManager"); getConnectionUsingDriverManag...
getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=neelima;securityMechanism="+SECMEC_USRIDONL),"T6:");
getConnectionUsingDriverManager(getJDBCUrl("wombat","user=neelima;securityMechanism="+SECMEC_USRIDONL),"T6:");
protected void runTest() { // Test cases with get connection via drivermanager and using // different security mechanisms. // Network server supports SECMEC_USRIDPWD, SECMEC_USRIDONL,SECMEC_EUSRIDPWD System.out.println("Checking security mechanism authentication with DriverManager"); getConnectionUsingDriverManag...
getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=neelima;password=lee;securityMechanism="+SECMEC_USRIDONL),"T8:");
getConnectionUsingDriverManager(getJDBCUrl("wombat","user=neelima;password=lee;securityMechanism="+SECMEC_USRIDONL),"T8:");
protected void runTest() { // Test cases with get connection via drivermanager and using // different security mechanisms. // Network server supports SECMEC_USRIDPWD, SECMEC_USRIDONL,SECMEC_EUSRIDPWD System.out.println("Checking security mechanism authentication with DriverManager"); getConnectionUsingDriverManag...
return new NetCallableStatement(netAgent_, this, sql, type, concurrency, holdability).callableStatement_;
return new NetCallableStatement(netAgent_, this, sql, type, concurrency, holdability,pooledConnection_).callableStatement_;
protected CallableStatement newCallableStatement_(String sql, int type, int concurrency, int holdability) throws SqlException { return new NetCallableStatement(netAgent_, this, sql, type, concurrency, holdability).callableStatement_; }
return new NetPreparedStatement(netAgent_, this, sql, section).preparedStatement_;
return new NetPreparedStatement(netAgent_, this, sql, section,pooledConnection_).preparedStatement_;
protected PreparedStatement newPositionedUpdatePreparedStatement_(String sql, org.apache.derby.client.am.Section section) throws SqlException { return new NetPreparedStatement(netAgent_, this, sql, section).preparedStatement_; }
return new NetPreparedStatement(netAgent_, this, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames).preparedStatement_;
return new NetPreparedStatement(netAgent_, this, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames,pooledConnection_).preparedStatement_;
protected PreparedStatement newPreparedStatement_(String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames) throws SqlException { return new NetPreparedStatement(netAgent_, this, sql, type, concurrency, holdability, autoGeneratedKeys, columnNames).preparedStatement_...
throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is on the insert " + "row or if this ResultSet object has a concurrency of CONCUR_READ_ONLY.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NOT_POSITIONED_ON_INSERT_ROW));
public void cancelRowUpdates() throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "cancelRowUpdates"); } checkForClosedResultSet(); if (isOn...
throw new SqlException(agent_.logWriter_, "Invalid operation " + "at current cursor position.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
public void cancelRowUpdates() throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "cancelRowUpdates"); } checkForClosedResultSet(); if (isOn...
throw new SqlException(agent_.logWriter_, "Invalid operation: result set closed");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.ALREADY_CLOSED), "ResultSet");
protected final void checkForClosedResultSet() throws SqlException { if (!openOnClient_) { agent_.checkForDeferredExceptions(); throw new SqlException(agent_.logWriter_, "Invalid operation: result set closed"); } else { agent_.checkForDeferredExceptions(); } ...
throw new SqlException(agent_.logWriter_, "Invalid argument: parameter index " + column + " is out of range.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.LANG_INVALID_COLUMN_POSITION), new Integer(column), new Integer(resultSetMetaData_.columns_));
final void checkForValidColumnIndex(int column) throws SqlException { if (column < 1 || column > resultSetMetaData_.columns_) { throw new SqlException(agent_.logWriter_, "Invalid argument: parameter index " + column + " is out of range."); } }
throw new SqlException(agent_.logWriter_, "Invalid operation to read at current cursor position.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
private final void checkForValidCursorPosition() throws SqlException { if (!isValidCursorPosition_) { throw new SqlException(agent_.logWriter_, "Invalid operation to read at current cursor position."); } }
throw new SqlException(agent_.logWriter_, "This method should not be called on sensitive dynamic cursors.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_FOR_SENSITIVE_DYNAMIC));
private final void checkThatResultSetIsNotDynamic() throws SqlException { if (sensitivity_ == sensitivity_sensitive_dynamic__) { throw new SqlException(agent_.logWriter_, "This method should not be called on sensitive dynamic cursors."); } }
throw new SqlException(agent_.logWriter_, "This method should only be called on ResultSet objects that are " + "scrollable(type TYPE_SCROLL_SENSITIVE or TYPE_SCROLL_INSENSITIVE)");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_MUST_BE_SCROLLABLE));
private final void checkThatResultSetTypeIsScrollable() throws SqlException { if (resultSetType_ == java.sql.ResultSet.TYPE_FORWARD_ONLY) { throw new SqlException(agent_.logWriter_, "This method should only be called on ResultSet objects that are " + "scrollable(type TYPE_SCROLL...
private void checkUpdatableCursor() throws SqlException {
private void checkUpdatableCursor(String methodName) throws SqlException {
private void checkUpdatableCursor() throws SqlException { if (resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method should only be called on ResultSet objects " + "that are updatable(concurrency...
throw new SqlException(agent_.logWriter_, "This method should only be called on ResultSet objects " + "that are updatable(concurrency type CONCUR_UPDATABLE).");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.UPDATABLE_RESULTSET_API_DISALLOWED), methodName);
private void checkUpdatableCursor() throws SqlException { if (resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method should only be called on ResultSet objects " + "that are updatable(concurrency...
throw new SqlException(agent_.logWriter_, "ResultSet is not updatable.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.UPDATABLE_RESULTSET_API_DISALLOWED), "updateXXX");
private final void checkUpdatePreconditions(int column) throws SqlException { checkForClosedResultSet(); checkForValidColumnIndex(column); if (resultSetConcurrency_ != java.sql.ResultSet.CONCUR_UPDATABLE) { throw new SqlException(agent_.logWriter_, "ResultSet is not updatable."); ...
throw new SqlException(agent_.logWriter_, "This method must be called to update values in the current row " + "or the insert row");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NOT_ON_CURRENT_OR_INSERT_ROW));
private final void checkUpdatePreconditions(int column) throws SqlException { checkForClosedResultSet(); checkForValidColumnIndex(column); if (resultSetConcurrency_ != java.sql.ResultSet.CONCUR_UPDATABLE) { throw new SqlException(agent_.logWriter_, "ResultSet is not updatable."); ...
throw new SqlException(agent_.logWriter_, "Column not updatable");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_COLUMN_NOT_UPDATABLE));
private final void checkUpdatePreconditions(int column) throws SqlException { checkForClosedResultSet(); checkForValidColumnIndex(column); if (resultSetConcurrency_ != java.sql.ResultSet.CONCUR_UPDATABLE) { throw new SqlException(agent_.logWriter_, "ResultSet is not updatable."); ...
throw new SqlException(agent_.logWriter_, "Invalid operation to " + "update at current cursor position");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
private final void checkUpdatePreconditions(int column) throws SqlException { checkForClosedResultSet(); checkForValidColumnIndex(column); if (resultSetConcurrency_ != java.sql.ResultSet.CONCUR_UPDATABLE) { throw new SqlException(agent_.logWriter_, "ResultSet is not updatable."); ...
e , "Failed to close inputStream.");
new MessageId(SQLState.JAVA_EXCEPTION), "java.io.IOException", e.getMessage(), e);
private void closeCloseFilterInputStream() throws SqlException { if(is_ != null){ try{ is_.close(); }catch(IOException e){ throw new SqlException(agent_.logWriter_ , e , "Failed to close inputStream."); } is_ = null; } }
throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is on the insert " + "row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NOT_POSITIONED_ON_INSERT_ROW));
private void deleteRowX() throws SqlException { checkForClosedResultSet(); // discard all previous updates resetUpdatedColumns(); if (isOnInsertRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method cannot...
throw new SqlException(agent_.logWriter_, "jdbc 2 method not yet implemented");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
public java.sql.Array getArray(int column) throws SQLException { try { closeCloseFilterInputStream(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getArray", column); } checkGetterPreconditions(column); java.sql.A...
throw new SqlException(agent_.logWriter_, "No updateXXX issued on this row.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NO_UPDATE_CALLS_ON_CURRENT_ROW));
private void getPreparedStatementForUpdate() throws SqlException { // each column is associated with a tableName in the extended describe info. String updateString = buildUpdateString(); if (updateString == null) { throw new SqlException(agent_.logWriter_, "No updateXXX issued on thi...
throw new SqlException(agent_.logWriter_, "jdbc 2 method not yet implemented");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.JDBC_METHOD_NOT_IMPLEMENTED));
public java.sql.Ref getRef(int column) throws SQLException { try { closeCloseFilterInputStream(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getRef", column); } checkGetterPreconditions(column); java.sql.Ref ...
throw new SqlException(agent_.logWriter_, e, e.getMessage());
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.UNSUPPORTED_ENCODING), "String", "java.io.ByteArrayInputStream(UTF-8)", e);
public java.io.InputStream getUnicodeStream(int column) throws SQLException { try { closeCloseFilterInputStream(); if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "getUnicodeStream", column); } checkGetterPreconditi...
throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is not on the insert " + "row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NOT_POSITIONED_ON_INSERT_ROW));
private void insertRowX() throws SqlException { checkForClosedResultSet(); if (isOnCurrentRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is not on the insert " + ...
throw new SqlException(agent_.logWriter_, "Invalid operation to " + "insert at current cursor position");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
private void insertRowX() throws SqlException { checkForClosedResultSet(); if (isOnCurrentRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is not on the insert " + ...
checkUpdatableCursor();
checkUpdatableCursor("moveToCurrentRow()");
public void moveToCurrentRow() throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "moveToCurrentRow"); } checkForClosedResultSet(); checkUpd...
checkUpdatableCursor();
checkUpdatableCursor("moveToInsertRow()");
public void moveToInsertRow() throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "moveToInsertRow"); } checkForClosedResultSet(); checkUpdat...
"This method cannot be invoked while the cursor is on the insert " + "row, if the cursor is not on a valid row, or if this ResultSet " + "object has a concurrency of CONCUR_READ_ONLY.");
new MessageId(SQLState.CURSOR_CANNOT_INVOKE_ON_INSROW_OR_INVALIDROW_OR_READONLY));
private void refreshRowX() throws SqlException { checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); if (isBeforeFirstX() || isAfterLastX() || isOnInsertRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.l...
throw new SqlException(agent_.logWriter_, "Cursor is Not on a Valid Row");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
private boolean relativeX(int rows) throws SqlException { checkForClosedResultSet(); checkThatResultSetTypeIsScrollable(); clearWarningsX(); wasNull_ = ResultSet.WAS_NULL_UNSET; // discard all previous updates when moving the cursor. resetUpdatedColumns(); unuseStreams(); ...
throw new SqlException(agent_.logWriter_, "Invalid fetch direction " + direction);
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.INVALID_FETCH_DIRECTION), new Integer(direction));
public void setFetchDirection(int direction) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setFetchDirection", direction); } checkForClosedResultSet(...
throw new SqlException(agent_.logWriter_, "Invalid fetch size " + rows).getSQLException();
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.INVALID_FETCH_SIZE), new Integer(rows)).getSQLException();
public void setFetchSize(int rows) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setFetchSize", rows); } checkForClosedResultSet(); if...
throw new SqlException(agent_.logWriter_, "Invalid operation to update a non-nullable column to null.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.LANG_NULL_INTO_NON_NULL), new Integer(column));
public void updateNull(int column) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "updateNull", column); } checkUpdatePreconditions(column); ...
throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is on the insert " + "row or if the concurrency of this ResultSet object is CONCUR_READ_ONLY.");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_NOT_POSITIONED_ON_INSERT_ROW));
private boolean updateRowX() throws SqlException { checkForClosedResultSet(); if (isOnInsertRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is on the insert " + ...
throw new SqlException(agent_.logWriter_, "Invalid operation to " + "update at current cursor position");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
private boolean updateRowX() throws SqlException { checkForClosedResultSet(); if (isOnInsertRow_ || resultSetConcurrency_ == java.sql.ResultSet.CONCUR_READ_ONLY) { throw new SqlException(agent_.logWriter_, "This method cannot be invoked while the cursor is on the insert " + ...
"Stream of column value in result cannot be retrieved twice");
new MessageId(SQLState.LANG_STREAM_RETRIEVED_ALREADY));
void useStream(int columnIndex) throws SqlException { if(streamUsedFlags_[columnIndex - 1]){ throw new SqlException(agent_.logWriter_, "Stream of column value in result cannot be retrieved twice"); } streamUsedFlags_[columnIndex - 1] = true; }
throw new SqlException(agent_.logWriter_, "Invalid operation: wasNull() called with no data retrieved");
throw new SqlException(agent_.logWriter_, new MessageId(SQLState.WASNULL_INVALID));
public boolean wasNull() throws SQLException { try { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "wasNull"); } checkForClosedResultSet(); if (wasNull_ == ResultSet.WAS_NULL_UNSET) { throw new SqlException(a...
private void setColumnListToNotNull(ConstraintDefinitionNode cdn, TableDescriptor td) throws StandardException
private void setColumnListToNotNull(ConstraintDefinitionNode cdn)
private void setColumnListToNotNull(ConstraintDefinitionNode cdn, TableDescriptor td) throws StandardException { ResultColumnList rcl = cdn.getColumnList(); int rclSize = rcl.size(); for (int index = 0; index < rclSize; index++) { String colName = ((ResultColumn) rcl.elementAt(index)).getName(); /* For ALTER ...
if (td != null && cdn instanceof ConstraintDefinitionNode) { ColumnDescriptor cd = td.getColumnDescriptor(colName); if (cd != null && cd.getType().isNullable()) throw StandardException.newException(SQLState.LANG_DB2_ADD_UNIQUE_OR_PRIMARY_KEY_ON_NULL_COLS, colName); } setColumnToNotNull(colName); }
DataTypeDescriptor dtd = getColumnDataTypeDescriptor(colName); dtd.setNullability(false); }
private void setColumnListToNotNull(ConstraintDefinitionNode cdn, TableDescriptor td) throws StandardException { ResultColumnList rcl = cdn.getColumnList(); int rclSize = rcl.size(); for (int index = 0; index < rclSize; index++) { String colName = ((ResultColumn) rcl.elementAt(index)).getName(); /* For ALTER ...
server.setTraceDirectory(DERBY_SYSTEM_HOME);
public static void main (String args[]) throws Exception { try { NetworkServerControl server = new NetworkServerControl(); Properties p = server.getCurrentProperties(); p.list(System.out); ij.getPropertyArg(args); // create a connection in a different thread startConnection(); // wait for connection ...
static private void dumpSQLExceptions (SQLException se) {
public static void dumpSQLExceptions (SQLException se) {
static private void dumpSQLExceptions (SQLException se) { System.out.println("FAIL -- unexpected exception"); while (se != null) { System.out.print("SQLSTATE("+se.getSQLState()+"):"); se.printStackTrace(System.out); se = se.getNextException(); } }
Connection con = null, con2 = null, con3 = null;
Connection con = null, con2 = null;
public static void main(String[] args) { Connection con = null, con2 = null, con3 = null; Statement s; System.out.println("Test savepointJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); isDerbyNet...
isDerbyNet = TestUtil.isNetFramework(); con.setAutoCommit(true); s = con.createStatement();
public static void main(String[] args) { Connection con = null, con2 = null, con3 = null; Statement s; System.out.println("Test savepointJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); isDerbyNet...
con2.setAutoCommit(false); setUpTest(s); System.out.println("Tests common to DRDA and embedded Cloudscape"); genericTests(con, con2, s); System.out.println("Next try non-DRDA tests"); if (!isDerbyNet) nonDRDATests(con, s); s.close();
runTests("regular connections", con,con2);
public static void main(String[] args) { Connection con = null, con2 = null, con3 = null; Statement s; System.out.println("Test savepointJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); isDerbyNet...
con3 = ij.startJBMS(); con3.setAutoCommit(true); s = con3.createStatement(); TestUtil.cleanUpTest(s, testObjects); s.close(); con3.close();
public static void main(String[] args) { Connection con = null, con2 = null, con3 = null; Statement s; System.out.println("Test savepointJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); isDerbyNet...
System.out.println("Test savepointJdbc30 finished");
public static void main(String[] args) { Connection con = null, con2 = null, con3 = null; Statement s; System.out.println("Test savepointJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); isDerbyNet...
clientMessageIds.add(SQLState.CLIENT_RESULT_SET_NOT_OPEN);
static void initClientMessageIds() { // Add message ids that don't start with XJ here clientMessageIds.add(SQLState.NO_CURRENT_CONNECTION); clientMessageIds.add(SQLState.NOT_IMPLEMENTED); clientMessageIds.add(SQLState.CANNOT_CLOSE_ACTIVE_CONNECTION); clientMessageIds.add(SQLSta...
return execute(a, false, false, rollbackParentContext, timeoutMillis);
return execute(a, rollbackParentContext, timeoutMillis);
public ResultSet execute(LanguageConnectionContext lcc, boolean rollbackParentContext, long timeoutMillis) throws StandardException { Activation a = getActivation(lcc, false); a.setSingleExecution(); return execute(a, false, false, rollbackParentContext, t...
if (SanityManager.DEBUG) { assertAutoinc(autoinc, autoincInc, columnDefaultInfo); }
assertAutoinc(autoinc, autoincInc, columnDefaultInfo);
public ColumnDescriptor(String columnName, int columnPosition, DataTypeDescriptor columnType, DataValueDescriptor columnDefault, DefaultInfo columnDefaultInfo, TableDescriptor table, UUID defaultUUID, long autoincStart, long autoincInc, boolean autoinc) { this.columnName = columnName; this.column...
if (autoinc){ SanityManager.ASSERT((autoincInc != 0), "increment is zero for autoincrement column"); SanityManager.ASSERT((defaultInfo == null ||
if (SanityManager.DEBUG) { if (autoinc){ SanityManager.ASSERT((autoincInc != 0), "increment is zero for autoincrement column"); SanityManager.ASSERT((defaultInfo == null ||
private static void assertAutoinc(boolean autoinc, long autoincInc, DefaultInfo defaultInfo){ if (autoinc){ SanityManager.ASSERT((autoincInc != 0), "increment is zero for autoincrement column"); SanityManager.ASSERT((defaultInfo == null || defaultInfo.isDefaultValueAutoinc()), "If ...
}
private static void assertAutoinc(boolean autoinc, long autoincInc, DefaultInfo defaultInfo){ if (autoinc){ SanityManager.ASSERT((autoincInc != 0), "increment is zero for autoincrement column"); SanityManager.ASSERT((defaultInfo == null || defaultInfo.isDefaultValueAutoinc()), "If ...
protected String serializeToString(String xmlAsText)
protected String serializeToString(final String xmlAsText)
protected String serializeToString(String xmlAsText) throws Exception { ArrayList aList = new ArrayList(); aList.add(dBuilder.parse( new InputSource(new StringReader(xmlAsText)))); /* The second argument in the following call is for * catching cases where we have a ...
ArrayList aList = new ArrayList(); aList.add(dBuilder.parse( new InputSource(new StringReader(xmlAsText))));
final ArrayList aList = new ArrayList(); java.security.AccessController.doPrivileged( new java.security.PrivilegedExceptionAction() { public Object run() throws Exception { aList.add(dBuilder.parse( new InputSource(new StringReader(xmlAsText)))); return null; } });
protected String serializeToString(String xmlAsText) throws Exception { ArrayList aList = new ArrayList(); aList.add(dBuilder.parse( new InputSource(new StringReader(xmlAsText)))); /* The second argument in the following call is for * catching cases where we have a ...
SQLState.LANG_UNEXPECTED_XML_EXCEPTION, t);
SQLState.LANG_UNEXPECTED_XML_EXCEPTION, t, t.getMessage());
public SqlXmlUtil() throws StandardException { try { /* Note: Use of DocumentBuilderFactory means that we get * whatever XML parser is the "default" for the JVM in * use--and thus, we don't have to hard-code the parser * name, nor do we have to require that t...
SQLState.LANG_XML_QUERY_ERROR, te, opName);
SQLState.LANG_XML_QUERY_ERROR, te, opName, te.getMessage());
public void compileXQExpr(String queryExpr, String opName) throws StandardException { try { /* The following XPath constructor compiles the expression * as part of the construction process. We have to pass * in a PrefixResolver object in order to avoid NPEs when ...
static int getMonth(int encodedDate)
public NumberDataValue getMonth(NumberDataValue result) throws StandardException
static int getMonth(int encodedDate) { return ((encodedDate >>> 8) & 0x00ff); }
return ((encodedDate >>> 8) & 0x00ff);
if (SanityManager.DEBUG) { SanityManager.ASSERT(!isNull(), "getMonth called on a null"); } return SQLDate.setSource(getMonth(encodedDate), result);
static int getMonth(int encodedDate) { return ((encodedDate >>> 8) & 0x00ff); }
static int getYear(int encodedDate)
public NumberDataValue getYear(NumberDataValue result) throws StandardException
static int getYear(int encodedDate) { return (encodedDate >>> 16); }
return (encodedDate >>> 16);
if (SanityManager.DEBUG) { SanityManager.ASSERT(!isNull(), "getYear called on a null"); } return SQLDate.setSource(getYear(encodedDate), result);
static int getYear(int encodedDate) { return (encodedDate >>> 16); }
throw Util.notImplemented();
checkIfClosed(); return new EmbedBlob(new byte[0],this);
public Blob createBlob() throws SQLException { throw Util.notImplemented(); }
throw Util.notImplemented();
checkIfClosed(); return new EmbedClob("",this);
public Clob createClob() throws SQLException { throw Util.notImplemented(); }
if (verbose) logMessage("re-encrypting " + currentTestDatabase + " with " + connAttrs);
private Connection reEncryptDatabase() throws SQLException { String connAttrs = ""; if (encryptionType == USING_PASSWORD) { // re-encrypt the database. connAttrs = "bootPassword=" + OLD_PASSWORD + ";newBootPassword=" + NEW_PASSWORD; } if ...
recover(passwordKey); shutdown();
private void runCrashRecoveryTestCases(boolean reEncrypt) throws SQLException { Connection conn; if (reEncrypt) conn = createEncryptedDatabase(); else conn = createDatabase(); createTable(conn, TEST_TABLE_NAME); //load some rows insert(co...
recover(passwordKey); shutdown();
crash(reEncrypt, TEST_REENCRYPT_CRASH_AFTER_COMMT); crashInRecovery(passwordKey, TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_LOGFILE_DELETE); crash(reEncrypt, TEST_REENCRYPT_CRASH_AFTER_COMMT);
private void runCrashRecoveryTestCases(boolean reEncrypt) throws SQLException { Connection conn; if (reEncrypt) conn = createEncryptedDatabase(); else conn = createDatabase(); createTable(conn, TEST_TABLE_NAME); //load some rows insert(co...
recover(passwordKey); shutdown();
crash(reEncrypt, TEST_REENCRYPT_CRASH_AFTER_SWITCH_TO_NEWKEY); crashInRecovery(passwordKey, TEST_REENCRYPT_CRASH_AFTER_RECOVERY_UNDO_REVERTING_KEY); crash(reEncrypt, TEST_REENCRYPT_CRASH_AFTER_SWITCH_TO_NEWKEY); crashInRecovery(passwordKey, TEST_REENCRYPT_CRASH_BEFORE_RECOVERY_FINAL_CLEANUP);
private void runCrashRecoveryTestCases(boolean reEncrypt) throws SQLException { Connection conn; if (reEncrypt) conn = createEncryptedDatabase(); else conn = createDatabase(); createTable(conn, TEST_TABLE_NAME); //load some rows insert(co...
checkSysSchemas(conn);
private void runPhase(int version, int phase) throws Exception{ System.out.println("\n\nSTART - phase " + PHASES[phase]); URLClassLoader classLoader = null; switch(version) { case OLD_RELEASE: classLoader = oldClassLoader; break; case NEW_RELEASE: classLoader = newClassLoader; break; ...
ConnectionPoolDataSource cpDataSource = getConnectionPoolDataSource();
ConnectionPoolDataSource cpDataSource = TestDataSourceFactory.getConnectionPoolDataSource();
public void setUp() throws SQLException { //The ConnectionPoolDataSource object //used to get a PooledConnection object ConnectionPoolDataSource cpDataSource = getConnectionPoolDataSource(); PooledConnection pConn = cpDataSource.getPooledConnection(); ...
con = getXADataSource().getXAConnection().getConnection();
con = TestDataSourceFactory.getXADataSource().getXAConnection().getConnection();
public void setUp() throws SQLException { // Use a XADataSource to obtain a XAConnection object, and // finally a "real" connection. con = getXADataSource().getXAConnection().getConnection(); }
version+="."+maint%MAINT_DIV+" ("+prop.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER)+")"; tmpProp.put(PLUGIN_VERSION_BUILD_NUMBER,version);
version+="."+maint%MAINT_DIV; tmpProp.put(PLUGIN_VERSION_BUILD_NUMBER,version+" ("+prop.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER)+")");
private void getProps() throws Exception{ InputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.DBMS_INFO); Properties prop=new Properties(); prop.load(versionStream); //create the tmp Prop file tmpProp.put(PLUGIN_PKG,PLUGIN_PKG_NAME); //package name tmpProp.put(PLUGIN_ZIP_FILE,PLUGIN_ZI...
return new DirFile4( dataDirectory, rwsOK); return new DirFile4(dataDirectory, path, rwsOK);
return new DirFile4(dir, rwsOK); return new DirFile4(dir, path, rwsOK);
StorageFile newPersistentFile( String path) { if( path == null) return new DirFile4( dataDirectory, rwsOK); return new DirFile4(dataDirectory, path, rwsOK); }
private void checkForClosedConnection() throws SQLException
protected void checkForClosedConnection() throws SQLException
private void checkForClosedConnection() throws SQLException { try { checkForClosedConnectionX(); } catch ( SqlException se ) { throw se.getSQLException(); } }
if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
if ((rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY) && isDerbyNetClient)
static boolean scrollSensitiveTest( Connection conn) throws SQLException { ResultSet rs; SQLWarning warning; Statement s_s_r = null; // sensitive, read only Statement s_s_u = null; // sensitive, updatable s_s_r = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); // We ...
if (warningCount != 2)
if (warningCount != 2 && isDerbyNetClient)
public static boolean testCallableStatements( Connection conn) throws SQLException { boolean passed = true; int warningCount = 0; SQLWarning warning; CallableStatement cs_s_r = null; // sensitive, read only CallableStatement cs_s_u = null; // sensitive, updatable CallableStatement cs_i_r = null; // insensit...
if (warningCount != 1)
if (warningCount != 1 && isDerbyNetClient)
public static boolean testCallableStatements( Connection conn) throws SQLException { boolean passed = true; int warningCount = 0; SQLWarning warning; CallableStatement cs_s_r = null; // sensitive, read only CallableStatement cs_s_u = null; // sensitive, updatable CallableStatement cs_i_r = null; // insensit...
passed = false; } if (warningCount != 0 && !isDerbyNetClient) { System.out.println("warningCount expected to be 0, not " + warningCount);
public static boolean testCallableStatements( Connection conn) throws SQLException { boolean passed = true; int warningCount = 0; SQLWarning warning; CallableStatement cs_s_r = null; // sensitive, read only CallableStatement cs_s_u = null; // sensitive, updatable CallableStatement cs_i_r = null; // insensit...
inBackupBlockingState = false;
protected Xact( XactFactory xactFactory, LogFactory logFactory, DataFactory dataFactory, boolean readOnly, Object compatibilitySpace) { super(); this.xactFactory = xactFactory; this.logFactory = logFactory; this.dataFactory = dataFactory; this.readOnly = readOnly; this.compatib...
setUnblockBackupState();
protected void postComplete(int commitflag, Integer commitOrAbort) throws StandardException { if (postCompleteMode) doComplete(commitOrAbort); // if we are want to commitNoSync with KEEP_LOCKS flag set, don't // release any locks if ((commitflag & Transaction.KEEP_LOCKS) == 0) { releaseAllLocks(); ...
double tempResult;
public NumberDataValue times(NumberDataValue left, NumberDataValue right, NumberDataValue result) throws StandardException { double tempResult; if (result == null) { result = new SQLDecimal(); } if (left.isNull() || right.isNull()) { result.setToNull(); return result; } result.setValue(le...
if (!JDBC.classpathMeetsXMLReqs())
if (!XML.classpathMeetsXMLReqs())
public static Test suite() { TestSuite suite = new TestSuite("XML Type and Operators Suite\n"); if (!JDBC.classpathMeetsXMLReqs()) return suite; // First wrap the tests in a TestSetup that sets up / tears down // the "fixture", and run those wrapped tests in embedded mode. ...
checkForSupportedDataType(targetJdbcType);
private void setObjectX(int parameterIndex, Object x, int targetJdbcType, int scale) throws SqlException { parameterIndex = checkSetterPreconditions(parameterIndex); checkForValidScale(scale); if (x == null) { ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getNClob1() { try { NClob nclob = cs.getNClob(0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } ca...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getNClob2(){ try { NClob nclob = cs.getNClob(null); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getRowId1() { try { cs.getRowId(0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } catc...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getRowId2() { try { cs.getRowId(null); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } catch(Excepti...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getSQLXML1() { try { SQLXML sqlxml = cs.getSQLXML(0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_getSQLXML2() { try { SQLXML sqlxml = cs.getSQLXML(null); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_setBlob() { try { cs.setBlob(null,null,0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_setClob() { try { cs.setClob(null,null,0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_setNCharacterStream() { try { cs.setNCharacterStream(null,null,0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); ...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_setNClob1() { try { cs.setNClob(null,null); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } catch(Ex...
if(!message.equals(e.getMessage())) {
if(SQLState.NOT_IMPLEMENTED.equals (e.getSQLState())) {
void t_setNClob2() { try { cs.setNClob(null,null,0); System.out.println("Not Implemented Exception not thrown"); } catch(SQLException e) { if(!message.equals(e.getMessage())) { System.out.println("Unexpected SQLException"+e); } } catch(...