rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public FormatableArrayHolder(Object[] array)
public FormatableArrayHolder()
public FormatableArrayHolder(Object[] array) { if (SanityManager.DEBUG) { SanityManager.ASSERT(array != null, "array input to constructor is null, code can't handle this."); } this.array = array; }
if (SanityManager.DEBUG) { SanityManager.ASSERT(array != null, "array input to constructor is null, code can't handle this."); } this.array = array;
public FormatableArrayHolder(Object[] array) { if (SanityManager.DEBUG) { SanityManager.ASSERT(array != null, "array input to constructor is null, code can't handle this."); } this.array = array; }
public boolean[] isAscending()
public boolean isAscending(Integer keyColumnPosition)
public boolean[] isAscending() { return id.isAscending(); }
return id.isAscending();
return id.isAscending(keyColumnPosition);
public boolean[] isAscending() { return id.isAscending(); }
void markUpdated(ResultColumnList updateColumns)
void markUpdated()
void markUpdated(ResultColumnList updateColumns) { ResultColumn updateColumn; ResultColumn resultColumn; int size = updateColumns.size(); for (int index = 0; index < size; index++) { updateColumn = (ResultColumn) updateColumns.elementAt(index); resultColumn = getResultColumn(updateColumn.getName()); /* **...
ResultColumn updateColumn; ResultColumn resultColumn; int size = updateColumns.size();
int size = size();
void markUpdated(ResultColumnList updateColumns) { ResultColumn updateColumn; ResultColumn resultColumn; int size = updateColumns.size(); for (int index = 0; index < size; index++) { updateColumn = (ResultColumn) updateColumns.elementAt(index); resultColumn = getResultColumn(updateColumn.getName()); /* **...
updateColumn = (ResultColumn) updateColumns.elementAt(index); resultColumn = getResultColumn(updateColumn.getName()); if (resultColumn != null) { resultColumn.markUpdated(); }
((ResultColumn) elementAt(index)).markUpdated();
void markUpdated(ResultColumnList updateColumns) { ResultColumn updateColumn; ResultColumn resultColumn; int size = updateColumns.size(); for (int index = 0; index < size; index++) { updateColumn = (ResultColumn) updateColumns.elementAt(index); resultColumn = getResultColumn(updateColumn.getName()); /* **...
static int computeEncodedDate(java.util.Date value, Calendar currentCal) throws StandardException { if (value == null) return 0; if( currentCal == null) currentCal = new GregorianCalendar(); currentCal.setTime(value); return SQLDate.computeEncodedDate(currentCal);
static int computeEncodedDate(Calendar cal) throws StandardException { return computeEncodedDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DATE));
static int computeEncodedDate(java.util.Date value, Calendar currentCal) throws StandardException { if (value == null) return 0; //encoded dates have a 0 value for null if( currentCal == null) currentCal = new GregorianCalendar(); currentCal.setTime(value); return SQLDate.computeEncodedD...
addOrLoadBestPlanMapping(true, this);
updateBestPlanMap(ADD_PLAN, this);
public CostEstimate optimizeIt( Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException { /* ** RESOLVE: Most types of Optimizables only implement estimateCost(), ** and leave it up to optimizeIt() in FromTable to fi...
public GenericResultDescription ( ResultDescription rd, int[] theCols )
public GenericResultDescription()
public GenericResultDescription ( ResultDescription rd, int[] theCols ) { if (SanityManager.DEBUG) { SanityManager.ASSERT(theCols != null, "theCols argument to GenericResultDescription is null"); } this.columns = new ResultColumnDescriptor[theCols.length]; for (int i = 0; i < theCols.length; i++) { co...
if (SanityManager.DEBUG) { SanityManager.ASSERT(theCols != null, "theCols argument to GenericResultDescription is null"); } this.columns = new ResultColumnDescriptor[theCols.length]; for (int i = 0; i < theCols.length; i++) { columns[i] = rd.getColumnDescriptor(theCols[i]); } this.statementType = rd.getStatementType()...
public GenericResultDescription ( ResultDescription rd, int[] theCols ) { if (SanityManager.DEBUG) { SanityManager.ASSERT(theCols != null, "theCols argument to GenericResultDescription is null"); } this.columns = new ResultColumnDescriptor[theCols.length]; for (int i = 0; i < theCols.length; i++) { co...
FileReader fr;
BufferedReader fr;
private void processFile(String filename) throws IOException, DRDAProtocolException { String prev_filename = current_filename; current_filename = filename; String hostName=getHostName(); FileReader fr; try { fr = new FileReader(filename); } catch (FileNotFoundException fnfe) { // if us...
fr = new FileReader(filename);
fr = new BufferedReader(new InputStreamReader(new FileInputStream(filename),"UTF-8"));
private void processFile(String filename) throws IOException, DRDAProtocolException { String prev_filename = current_filename; current_filename = filename; String hostName=getHostName(); FileReader fr; try { fr = new FileReader(filename); } catch (FileNotFoundException fnfe) { // if us...
fr = new FileReader(userdir + sep + ".." + sep + filename);
fr = new BufferedReader (new InputStreamReader(new FileInputStream(userdir + sep + ".." + sep + filename),"UTF-8"));
private void processFile(String filename) throws IOException, DRDAProtocolException { String prev_filename = current_filename; current_filename = filename; String hostName=getHostName(); FileReader fr; try { fr = new FileReader(filename); } catch (FileNotFoundException fnfe) { // if us...
throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND, getFullColumnName());
throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND, getSQLColumnName());
public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { ResultColumn matchingRC; if (SanityManager.DEBUG) { SanityManager.ASSERT(fromList != null, "fromList is expected to be non-null"); } if (fromList.size() == 0) { throw Standar...
CompilerContext cc = getCompilerContext(); cc.addRequiredColumnPriv( resultColumn.getTableColumnDescriptor());
if (fromTable.isPrivilegeCollectionRequired()) getCompilerContext().addRequiredColumnPriv( resultColumn.getTableColumnDescriptor());
public ResultColumn bindColumnReference(ColumnReference columnReference) throws StandardException { boolean columnNameMatch = false; boolean tableNameMatch = false; FromTable fromTable; int currentLevel = -1; int previousLevel = -1; ResultColumn matchingRC = null; ResultColumn resultColumn; Strin...
closeMethodArgument(acb, mb);
public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { /* By the time we get here we should be a union all. * (We created a DistinctNode above us, if needed, * to eliminate the duplicates earlier.) */ if (SanityManager.DEBUG) { SanityManager.ASSERT(all,...
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUnionResultSet", ClassName.NoPutResultSet, 6);
mb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, "getUnionResultSet", ClassName.NoPutResultSet, 5);
public void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { /* By the time we get here we should be a union all. * (We created a DistinctNode above us, if needed, * to eliminate the duplicates earlier.) */ if (SanityManager.DEBUG) { SanityManager.ASSERT(all,...
closeMethodArgument(acb, mb);
public void generate( ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { /* Get the next ResultSet #, so that we can number this ResultSetNode, its * ResultColumnList and ResultSet. */ assignResultSetNumber(); // Get our final cost estimate based on the chil...
ClassName.NoPutResultSet, 11);
ClassName.NoPutResultSet, 10);
public void generate( ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { /* Get the next ResultSet #, so that we can number this ResultSetNode, its * ResultColumnList and ResultSet. */ assignResultSetNumber(); // Get our final cost estimate based on the chil...
tc.startTest();
tc.startTest( conn_main );
public static void main(String args[]) { try { TestConnection tc = new TestConnection(); tc.startTest(); } catch(Exception e) { System.out.println("Exception occurred in code StartTestConnection " + e); e.printStackTrace(); } }
void startTest() { Connection conn = createEmbeddedConnection(); closeConnection(conn); Connection conn1 = createClientConnection(); closeConnection(conn1);
void startTest( Connection conn_main ) { try { closeConnection(conn_main); } catch(Exception e) { System.out.println(""+e); e.printStackTrace(); }
void startTest() { Connection conn = createEmbeddedConnection(); closeConnection(conn); Connection conn1 = createClientConnection(); closeConnection(conn1); }
public static final int writeInt(OutputStream out, int value) throws IOException {
public static final int writeInt(DataOutput out, int value) throws IOException {
public static final int writeInt(OutputStream out, int value) throws IOException { if (value < 0) throw new IOException(); if (value <= 0x3f) { out.write(value); return 1; } if (value <= 0x3fff) { out.write(0x40 | (value >>> 8)); out.write(value & 0xff); return 2; } out.write(((value >>> 24) | 0x80) ...
out.write(value);
out.writeByte(value);
public static final int writeInt(OutputStream out, int value) throws IOException { if (value < 0) throw new IOException(); if (value <= 0x3f) { out.write(value); return 1; } if (value <= 0x3fff) { out.write(0x40 | (value >>> 8)); out.write(value & 0xff); return 2; } out.write(((value >>> 24) | 0x80) ...
out.write(0x40 | (value >>> 8)); out.write(value & 0xff);
out.writeByte(0x40 | (value >>> 8)); out.writeByte(value & 0xff);
public static final int writeInt(OutputStream out, int value) throws IOException { if (value < 0) throw new IOException(); if (value <= 0x3f) { out.write(value); return 1; } if (value <= 0x3fff) { out.write(0x40 | (value >>> 8)); out.write(value & 0xff); return 2; } out.write(((value >>> 24) | 0x80) ...
out.write(((value >>> 24) | 0x80) & 0xff); out.write((value >>> 16) & 0xff); out.write((value >>> 8) & 0xff); out.write((value) & 0xff);
out.writeByte(((value >>> 24) | 0x80) & 0xff); out.writeByte((value >>> 16) & 0xff); out.writeByte((value >>> 8) & 0xff); out.writeByte((value) & 0xff);
public static final int writeInt(OutputStream out, int value) throws IOException { if (value < 0) throw new IOException(); if (value <= 0x3f) { out.write(value); return 1; } if (value <= 0x3fff) { out.write(0x40 | (value >>> 8)); out.write(value & 0xff); return 2; } out.write(((value >>> 24) | 0x80) ...
public <T> T createQueryObject(Class<T> ifc) throws SQLException { throw SQLExceptionFactory.notImplemented ("createQueryObject (Class<T>)");
public <T extends BaseQuery> T createQueryObject(Class<T> ifc) throws SQLException { return QueryObjectFactory.createDefaultQueryObject (ifc, this);
public <T> T createQueryObject(Class<T> ifc) throws SQLException { throw SQLExceptionFactory.notImplemented ("createQueryObject (Class<T>)"); }
propval = PropertyUtil.getSystemProperty( Property.DRDA_PROP_SECURITYMECHANISM); if (propval != null){ setSecurityMechanism(propval); }
private void getPropertyInfo() throws Exception { //set values according to properties String directory = PropertyUtil.getSystemProperty(Property.SYSTEM_HOME_PROPERTY); String propval = PropertyUtil.getSystemProperty( Property.DRDA_PROP_LOGCONNECTIONS); if (propval != null && StringUtil.SQLEqualsIgnoreCase(pr...
if ( getSecurityMechanism() != INVALID_OR_NOTSET_SECURITYMECHANISM ) retval.put( Property.DRDA_PROP_SECURITYMECHANISM, getStringValueForSecMec(getSecurityMechanism()));
private Properties getPropertyValues() { Properties retval = new Properties(); retval.put(Property.DRDA_PROP_PORTNUMBER, new Integer(portNumber).toString()); retval.put(Property.DRDA_PROP_HOSTNAME, hostArg); retval.put(Property.DRDA_PROP_KEEPALIVE, new Boolean(keepAlive).toString()); String tracedir = getTraceDir...
public memCheck (int num) { delay = num; }
public memCheck () {}
public memCheck (int num) { delay = num;}
public static String getLocalizedMessage(Locale locale, String messageId, Object [] args)
public static void getLocalizedMessage(int sqlcode, short errmcLen, String sqlerrmc, String sqlerrp, int errd0, int errd1, int errd2, int errd3, int errd4, int errd5, String warn, String sqlState, String file, String localeStr, String[] msg, int[] rc)
public static String getLocalizedMessage(Locale locale, String messageId, Object [] args) { String locMsg = null; try { locMsg = formatMessage(getBundleForLocale(locale, messageId), messageId, args, true); return locMsg; } catch (MissingResourceException mre) { // message does not exist in the requested local...
String locMsg = null;
int _pos1 = localeStr.indexOf("_"); int _pos2 = localeStr.lastIndexOf("_"); Locale locale = EN; if (_pos1 != -1) { String language = localeStr.substring(0, _pos1); if (_pos2 == _pos1) { String country = localeStr.substring(_pos1 + 1); locale = new Locale(language, country); } else { String country = localeStr.substrin...
public static String getLocalizedMessage(Locale locale, String messageId, Object [] args) { String locMsg = null; try { locMsg = formatMessage(getBundleForLocale(locale, messageId), messageId, args, true); return locMsg; } catch (MissingResourceException mre) { // message does not exist in the requested local...
locMsg = formatMessage(getBundleForLocale(locale, messageId), messageId, args, true); return locMsg;
msg[0] = formatMessage(getBundleForLocale(locale, messageId), messageId, arguments, true); rc[0] = 0; return;
public static String getLocalizedMessage(Locale locale, String messageId, Object [] args) { String locMsg = null; try { locMsg = formatMessage(getBundleForLocale(locale, messageId), messageId, args, true); return locMsg; } catch (MissingResourceException mre) { // message does not exist in the requested local...
locMsg = formatMessage(getBundleForLocale(EN, messageId), messageId, args, false); return locMsg;
msg[0] = formatMessage(getBundleForLocale(EN, messageId), messageId, arguments, false); rc[0] = 0;
public static String getLocalizedMessage(Locale locale, String messageId, Object [] args) { String locMsg = null; try { locMsg = formatMessage(getBundleForLocale(locale, messageId), messageId, args, true); return locMsg; } catch (MissingResourceException mre) { // message does not exist in the requested local...
suite.addTest(SQLAuthorizationPropTest.suite());
public static Test suite() { TestSuite suite = new TestSuite("lang"); // DERBY-1315 and DERBY-1735 need to be addressed // before re-enabling this test as it's memory use is // different on different vms leading to failures in // the nightly runs. // suite.addTest(largeCodeG...
String dir = dataDirectory; if (canonicalName != null && path != null && home != null && !path.startsWith(home)) { dir = canonicalName; }
StorageFile newPersistentFile( String path) { String dir = dataDirectory; if (canonicalName != null && path != null && home != null && !path.startsWith(home)) { dir = canonicalName; } if( path == null) return new DirFile4(dir, rwsOK); retur...
return new DirFile4(dir, rwsOK); return new DirFile4(dir, path, rwsOK);
return new DirFile4(dataDirectory, rwsOK); return new DirFile4(dataDirectory, path, rwsOK);
StorageFile newPersistentFile( String path) { String dir = dataDirectory; if (canonicalName != null && path != null && home != null && !path.startsWith(home)) { dir = canonicalName; } if( path == null) return new DirFile4(dir, rwsOK); retur...
private void callCompress(
protected void callCompress(
private void callCompress( Connection conn, String schemaName, String tableName, boolean purgeRows, boolean defragmentRows, boolean truncateEnd, boolean commit_operation) throws SQLException { CallableStatement cstmt = conn.prepareCall( ...
createAndLoadTable(conn, create_table, table_name, num_rows);
createAndLoadTable(conn, create_table, table_name, num_rows, 0);
private void checkPurgePhase( Connection conn, boolean create_table, boolean long_table, String schemaName, String table_name, int num_rows) throws SQLException { testProgress( "begin checkPurgePhase" + num_rows + " row test, create = " + ...
private void createAndLoadTable(
protected void createAndLoadTable(
private void createAndLoadTable( Connection conn, boolean create_table, String tblname, int num_rows) throws SQLException { if (create_table) { Statement s = conn.createStatement(); s.execute( "create table " + tblname + ...
int num_rows)
int num_rows, int start_value)
private void createAndLoadTable( Connection conn, boolean create_table, String tblname, int num_rows) throws SQLException { if (create_table) { Statement s = conn.createStatement(); s.execute( "create table " + tblname + ...
for (;row_count < num_rows; row_count++)
for (int i = start_value; row_count < num_rows; row_count++, i++)
private void createAndLoadTable( Connection conn, boolean create_table, String tblname, int num_rows) throws SQLException { if (create_table) { Statement s = conn.createStatement(); s.execute( "create table " + tblname + ...
insert_stmt.setInt(1, row_count); insert_stmt.setInt(2, row_count * 10); insert_stmt.setInt(3, row_count * 100); insert_stmt.setInt(4, -row_count); insert_stmt.setString(5, data1_str); insert_stmt.setString(6, data2_str);
insert_stmt.setInt(1, i); insert_stmt.setInt(2, i * 10); insert_stmt.setInt(3, i * 100); insert_stmt.setInt(4, -i); insert_stmt.setString(5, data1_str); insert_stmt.setString(6, data2_str);
private void createAndLoadTable( Connection conn, boolean create_table, String tblname, int num_rows) throws SQLException { if (create_table) { Statement s = conn.createStatement(); s.execute( "create table " + tblname + ...
createAndLoadTable(conn, create_table, table_name, num_rows);
createAndLoadTable(conn, create_table, table_name, num_rows, 0);
private void deleteAllRows( Connection conn, boolean create_table, boolean long_table, String schemaName, String table_name, int num_rows) throws SQLException { testProgress( "begin deleteAllRows," + num_rows + " row test, create = " + ...
createAndLoadTable(conn, create_table, table_name, num_rows);
createAndLoadTable(conn, create_table, table_name, num_rows, 0);
private void simpleDeleteAllRows( Connection conn, boolean create_table, boolean long_table, String schemaName, String table_name, int num_rows) throws SQLException { testProgress( "begin simpleDeleteAllRows," + num_rows + " row test, create...
SQLState.LANG_XML_QUERY_ERROR, xe, "XMLEXISTS");
SQLState.LANG_XML_QUERY_ERROR, xe, "XMLEXISTS", xe.getMessage());
public BooleanDataValue XMLExists(SqlXmlUtil sqlxUtil) throws StandardException { if (this.isNull()) { // if the user specified a context node and that context // is null, result of evaluating the query is null // (per SQL/XML 6.17:General Rules:1.a), which means that we ...
SQLState.LANG_INVALID_XML_DOCUMENT, t);
SQLState.LANG_INVALID_XML_DOCUMENT, t, t.getMessage());
public XMLDataValue XMLParse(String text, boolean preserveWS, SqlXmlUtil sqlxUtil) throws StandardException { try { if (preserveWS) { // Currently the only way a user can view the contents of // an XML value is by explicitly calling XMLSERIALIZE. // So do...
SQLState.LANG_XML_QUERY_ERROR, xe, "XMLQUERY");
SQLState.LANG_XML_QUERY_ERROR, xe, "XMLQUERY", xe.getMessage());
public XMLDataValue XMLQuery(XMLDataValue result, SqlXmlUtil sqlxUtil) throws StandardException { if (this.isNull()) { // if the context is null, we return null, // per SQL/XML[2006] 6.17:GR.1.a.ii.1. if (result == null) result = (XMLDataValue)getNewNull(); ...
timerFactory = (TimerFactory)Monitor.startSystemModule("org.apache.derby.iapi.services.timer.TimerFactory");
protected final void runWithState(Properties properties, PrintStream log) { bootProperties = properties; logging = log; // false indicates the full monitor is required, not the lite. if (!initialize(false)) return; // if monitor is already set then the system is already // booted or in the process of booting o...
otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier());
try { otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier()); } catch (StandardException se) { return false; }
protected boolean isPotentialService(ProtocolKey otherKey) { String otherCanonicalName; if (serviceType == null) otherCanonicalName = otherKey.getIdentifier(); else { otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier()); // if the service name cannot be converted into a canonical...
boolean isActiveService(ProtocolKey otherKey) {
boolean isActiveService() {
boolean isActiveService(ProtocolKey otherKey) { synchronized (this) { if (inShutdown) return false; if (!isPotentialService(otherKey)) return false; if (topModule != null) { if (SanityManager.DEBUG) { SanityManager.ASSERT(topModule.isTypeAndName(serviceType, key.getFactoryInterface(), key.getI...
if (inShutdown) return false; if (!isPotentialService(otherKey)) return false; if (topModule != null) { if (SanityManager.DEBUG) { SanityManager.ASSERT(topModule.isTypeAndName(serviceType, key.getFactoryInterface(), key.getIdentifier())); } return true; } while (!inShutdown && (topModule == null)) { try { wait(); ...
return (topModule != null);
boolean isActiveService(ProtocolKey otherKey) { synchronized (this) { if (inShutdown) return false; if (!isPotentialService(otherKey)) return false; if (topModule != null) { if (SanityManager.DEBUG) { SanityManager.ASSERT(topModule.isTypeAndName(serviceType, key.getFactoryInterface(), key.getI...
factory.allContexts = null; factory.threadContextList = null;
public static void stop() { ContextService.factory = null; }
public dblook(String[] args) {
public dblook(String[] args) throws Exception {
public dblook(String[] args) { // Adjust the application in accordance with derby.ui.locale // and derby.ui.codeset langUtil = LocalizedResource.getInstance(); // Initialize class variables. initState(); // Parse the command line. if (!parseArgs(args)) { System.out.println(lookupMessage("DBLOOK_Usage"))...
System.exit(1);
return;
public dblook(String[] args) { // Adjust the application in accordance with derby.ui.locale // and derby.ui.codeset langUtil = LocalizedResource.getInstance(); // Initialize class variables. initState(); // Parse the command line. if (!parseArgs(args)) { System.out.println(lookupMessage("DBLOOK_Usage"))...
go();
public dblook(String[] args) { // Adjust the application in accordance with derby.ui.locale // and derby.ui.codeset langUtil = LocalizedResource.getInstance(); // Initialize class variables. initState(); // Parse the command line. if (!parseArgs(args)) { System.out.println(lookupMessage("DBLOOK_Usage"))...
public void go(String srcUrl, String srcName)
private void go()
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExceptions(sqlE), (String)null); Logs.cleanup(); return; } catch (Exception e) { Logs.debug(e); Logs.cleanup(); return; }
this.conn = DriverManager.getConnection(sourceDBUrl); prepForDump();
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
DB_Jar.doJars(srcName, this.conn);
DB_Jar.doJars(sourceDBName, this.conn);
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
throw sqlE;
return;
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
throw e;
return;
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
conn.commit(); conn.close();
if (conn != null) { conn.commit(); conn.close(); }
public void go(String srcUrl, String srcName) throws Exception { try { // Connect to the database, prepare statements, // and load id-to-name mappings. this.conn = DriverManager.getConnection(srcUrl); try { prepForDump(); } catch (SQLException sqlE) { Logs.debug(sqlE); Logs.debug(Logs.unRollExcep...
dblook looker = new dblook(args);
public static void main(String[] args) { dblook looker = new dblook(args); try { looker.go(sourceDBUrl, sourceDBName); } catch (Exception e) { // Errors are logged and printed to console according // to command line arguments, so just ignore here. } }
looker.go(sourceDBUrl, sourceDBName);
new dblook(args);
public static void main(String[] args) { dblook looker = new dblook(args); try { looker.go(sourceDBUrl, sourceDBName); } catch (Exception e) { // Errors are logged and printed to console according // to command line arguments, so just ignore here. } }
e.printStackTrace();
public static void main(String[] args) { dblook looker = new dblook(args); try { looker.go(sourceDBUrl, sourceDBName); } catch (Exception e) { // Errors are logged and printed to console according // to command line arguments, so just ignore here. } }
if ((quotedName.indexOf("\"") == -1) && (quotedName.indexOf("'") == -1))
if (!(quotedName.startsWith("'") || quotedName.startsWith("\"")))
public static String stripQuotes(String quotedName) { if (quotedName == null) return null; if ((quotedName.indexOf("\"") == -1) && (quotedName.indexOf("'") == -1)) // nothing to do. return quotedName; return quotedName.substring(1, quotedName.length() - 1); }
if (!(quotedName.endsWith("'") || quotedName.endsWith("\""))) return quotedName;
public static String stripQuotes(String quotedName) { if (quotedName == null) return null; if ((quotedName.indexOf("\"") == -1) && (quotedName.indexOf("'") == -1)) // nothing to do. return quotedName; return quotedName.substring(1, quotedName.length() - 1); }
Logs.reportMessage("CSLOOK_StoredProcHeader");
Logs.reportMessage("DBLOOK_StoredProcHeader");
public static void doStoredProcedures(Connection conn) throws SQLException { // Note: it is safe to cast the long varchar column "javaclassname" // to varchar(128) because it is defined to correspond to the // 'aliasid' column for a given stored procedure; since the aliasid // column is varchar(128), javaclassnam...
throw SQLExceptionFactory.notImplemented("free()");
if (!isValid) return; isValid = false; if(isBinaryStream()) { try { binaryStream_.close(); } catch(IOException ioe) { throw new SqlException(null, new ClientMessageId(SQLState.IO_ERROR_UPON_LOB_FREE)).getSQLException(); } } else { binaryString_ = null; }
public void free() throws SQLException { throw SQLExceptionFactory.notImplemented("free()"); }
checkValidity();
public java.io.InputStream getBinaryStream() throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBinaryStream"); } java.io.InputStream retVal = g...
checkValidity();
public byte[] getBytes(long pos, int length) throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "getBytes", (int) pos, length); } if (pos <= 0) { ...
checkValidity();
public long length() throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "length"); } long retVal = super.sqlLength(); if (agent_.logg...
checkValidity();
public long position(byte[] pattern, long start) throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "position(byte[], long)", pattern, start); } if ...
checkValidity();
public java.io.OutputStream setBinaryStream(long pos) throws SQLException { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setBinaryStream", (int) pos); } BlobOutputStream outStream = new BlobOutputStream(...
checkValidity();
public int setBytes(long pos, byte[] bytes) throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setBytes", (int) pos, bytes); } int length = setByte...
checkValidity();
public void truncate(long len) throws SQLException { try { synchronized (agent_.connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, " truncate", (int) len); } if (len < 0 || len > this.length()) { ...
TestUtil.getConnection("wombat", "shutdown=true");
getDefaultConnection("shutdown=true");
public void grantRevokeAfterSettingSQLAuthProperty() throws SQLException{ // Shutdown the database for derby.database.sqlAuthorization property // to take effect. This was set by DatabasePropertyTestSetup decorator. try{ TestUtil.getConnection("wombat", "shutdown=true"); fail("FAIL: Failed to shutdown databas...
public JobEntryJobRunner(Job job, Result result, int entryNr) { this.job = job; this.result = result; this.log = LogWriter.getInstance(); this.entryNr = entryNr; finished=false; }
public JobEntryJobRunner(Job job, Result result, LogWriter log, int entryNr) { this.job = job; this.result = result; this.log = log; this.entryNr = entryNr; finished=false; this.parentThread = Thread.currentThread(); }
public JobEntryJobRunner(Job job, Result result, int entryNr) { this.job = job; this.result = result; this.log = LogWriter.getInstance(); this.entryNr = entryNr; finished=false; }
ps_close = conn.prepareStatement("create table temp(n int)");
ps_close = conn.prepareStatement("values 1");
void raiseCloseEvent() { try { ps_close = conn.prepareStatement("create table temp(n int)"); //call the close method on this prepared statement object //this should result in a statement event being generated //control is transferred to the sattementCLosed functio...
ps_error = conn.prepareStatement("create table temp(n int)");
ps_error = conn.prepareStatement("values 1");
void raiseErrorEvent() { try { ps_error = conn.prepareStatement("create table temp(n int)"); //close the connection associated with this prepared statement conn.close(); //Now execute the prepared statement this should cause an error ps_error...
conn = pooledConnection.getConnection();
xaconnection.addStatementEventListener(this);
public void setUp() throws SQLException { ConnectionPoolDataSource cpds = getConnectionPoolDataSource(); pooledConnection = cpds.getPooledConnection(); //register this class as a event listener for the //statement events pooledConnection.addStatementEventListener(this); ...
assertEquals("Database is shut down", dbShutDown, !fileExists(fileName));
boolean fileNotFound = false; int i = 0; do { Thread.sleep(500); fileNotFound = !fileExists(fileName); i ++; } while (fileNotFound != dbShutDown && i < 120); assertEquals("Database is shut down", dbShutDown, fileNotFound);
private void shutdownServerCheckDBShutDown(boolean dbShutDown) throws Exception { // connect to database createDatabase(); // shut down the server shutdownServer(); // check if db.lck exists String fileName = getSystemProperty("derby.system.home") + ...
public BaseTestCase(String name) { super(name); }
private BaseTestCase() {}
public BaseTestCase(String name) { super(name); }
currentRow = null;
public void close() throws StandardException { beginTime = getCurrentTimeMillis(); if ( isOpen ) { // we don't want to keep around a pointer to the // row ... so it can be thrown away. // REVISIT: does this need to be in a finally // block, to ensure that it is executed? clearCurrentRow(); currentRo...
if (((leftOptPredicates != null) && (leftOptPredicates.size() > 0)) || ((rightOptPredicates != null) && (rightOptPredicates.size() > 0)))
if (hasUnPushedPredicates())
public Optimizable modifyAccessPath(JBitSet outerTables, PredicateList predList) throws StandardException { // When we optimized this node we attempted to push predicates down to // the children, which means the best access path for the children // might depend on those predicates. So now that we're preparing //...
public ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap,
public void enhanceRCLForInsert(int numTargetColumns, int[] colMap,
public ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, DataDictionary dataDictionary, TableDescriptor targetTD, FromVTI targetVTI) throws StandardException { // our newResultCols are put into the bound form straight away. Resu...
int numResultSetColumns = resultColumns.size();
public ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, DataDictionary dataDictionary, TableDescriptor targetTD, FromVTI targetVTI) throws StandardException { // our newResultCols are put into the bound form straight away. Resu...
return this;
public ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, DataDictionary dataDictionary, TableDescriptor targetTD, FromVTI targetVTI) throws StandardException { // our newResultCols are put into the bound form straight away. Resu...
init();
init(0);
public LogAccessFileBuffer( int size) { buffer = new byte[size]; prev = null; next = null; init(); }
public void init()
public void init(int reserve)
public void init() { bytes_free = buffer.length; position = 0; }
bytes_free = buffer.length; position = 0;
length = buffer.length - reserve; bytes_free = length; position = reserve;
public void init() { bytes_free = buffer.length; position = 0; }
System.out.println("Testing Runtimeinfo (method)"); NetworkServerControl derbyServer = new NetworkServerControl( InetAddress.getByName("localhost"), NetworkServerControl.DEFAULT_PORTNUMBER); System.out.println(derbyServer.getRuntimeInfo()); System.out.println("End test (method)");
public static void main (String args[]) throws Exception { if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9")) jvm = jvm.getJvm("j9_13"); else jvm = jvm.getJvm("currentjvm"); // ensure compatibility vCmd = jvm.getCommandLine(); try { ij.getPropertyArg(args);...
suite.addTest(CharacterStreamsTest.suite());
public static Test suite() { TestSuite suite = new TestSuite("jdbcapi"); suite.addTest(ConcurrencyTest.suite()); suite.addTest(HoldabilityTest.suite()); suite.addTest(LobLengthTest.suite()); suite.addTest(ProcedureTest.suite()); suite.addTest(SURQueryMixTest.suite()); suite.addTest(SURTest.suite()); sui...
RawToBinaryFormatStream rawStream;
private void setBinaryStreamInternal(int parameterIndex, InputStream x, final boolean lengthLess, long length) throws SQLException { if ( !lengthLess && length < 0 ) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH); int jdbcTypeId = getPar...
new RawToBinaryFormatStream(x, (int)length), (int)length);
rawStream, (int)length);
private void setBinaryStreamInternal(int parameterIndex, InputStream x, final boolean lengthLess, long length) throws SQLException { if ( !lengthLess && length < 0 ) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH); int jdbcTypeId = getPar...
preparedStatement.getParameterTypes() [parameterIndex-1].getSQLstring());
getParameterSQLType(parameterIndex));
private void setCharacterStreamInternal(int parameterIndex, Reader reader, final boolean lengthLess, long length) throws SQLException { // Check for negative length if length i...
utfIn = new ReaderToUTF8Stream(reader, usableLength, truncationLength);
utfIn = new ReaderToUTF8Stream(reader, usableLength, truncationLength, getParameterSQLType(parameterIndex));
private void setCharacterStreamInternal(int parameterIndex, Reader reader, final boolean lengthLess, long length) throws SQLException { // Check for negative length if length i...
utfIn = new ReaderToUTF8Stream(reader, ReaderToUTF8Stream.UNKNOWN_LENGTH, 0);
utfIn = new ReaderToUTF8Stream(reader, colWidth, getParameterSQLType(parameterIndex));
private void setCharacterStreamInternal(int parameterIndex, Reader reader, final boolean lengthLess, long length) throws SQLException { // Check for negative length if length i...
super(in);
super(in); if (length < 0) { throw new IllegalArgumentException( "Stream length cannot be negative: " + length); } this.length = length; this.maximumLength = -1; this.typeName = null;
public RawToBinaryFormatStream(InputStream in, int length) { super(in); if (length >= 0) { setLimit(length); if (length <= 31) { encodedLength = new byte[1]; encodedLength[0] = (byte) (0x80 | (length & 0xff)); } el...
if (length >= 0) { setLimit(length); if (length <= 31) { encodedLength = new byte[1]; encodedLength[0] = (byte) (0x80 | (length & 0xff)); } else if (length <= 0xFFFF) { encodedLength = new byte[3]; encodedLength[0] = (byte) 0xA0; encodedLength[1] = (byte)(length >> 8); encodedLength[2] = (byte)(length); } else { encod...
setLimit(length); if (length <= 31) { encodedLength = new byte[1]; encodedLength[0] = (byte) (0x80 | (length & 0xff)); } else if (length <= 0xFFFF) { encodedLength = new byte[3]; encodedLength[0] = (byte) 0xA0; encodedLength[1] = (byte)(length >> 8); encodedLength[2] = (byte)(length); }
public RawToBinaryFormatStream(InputStream in, int length) { super(in); if (length >= 0) { setLimit(length); if (length <= 31) { encodedLength = new byte[1]; encodedLength[0] = (byte) (0x80 | (length & 0xff)); } el...