rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
Properties p = new Properties(); p.setProperty(name, value);
public void setClientInfo(String name, String value) throws SQLException{ checkIfClosed(); // Allow null to simplify compliance testing through // reflection, (test all methods in an interface with null // arguments) if (name == null && value == null) { return; ...
Connection bootDatabase(String password) throws SQLException {
Connection bootDatabase(int passwordKey) throws SQLException { String connAttrs = ""; if (encryptionType == USING_PASSWORD) { if (passwordKey == NEW) connAttrs = "bootPassword=" + NEW_PASSWORD; else if (passwordKey == OLD) connAttrs = "bootPassword=" + OLD_PASSWORD; }
Connection bootDatabase(String password) throws SQLException { return TestUtil.getConnection(TEST_DATABASE_NAME, "bootPassword=" + password); }
return TestUtil.getConnection(TEST_DATABASE_NAME, "bootPassword=" + password);
if (encryptionType == USING_KEY) { if (passwordKey == NEW) connAttrs = "encryptionKey=" + NEW_KEY; else if (passwordKey == OLD) connAttrs = "encryptionKey=" + OLD_KEY; } if (verbose) logMessage("booting " + currentTestDatabase + " with " + connAttrs); return TestUtil.getConnection(currentTestDatabase, connAttrs);
Connection bootDatabase(String password) throws SQLException { return TestUtil.getConnection(TEST_DATABASE_NAME, "bootPassword=" + password); }
private void createEncryptedDatabase() throws SQLException
private Connection createEncryptedDatabase() throws SQLException
private void createEncryptedDatabase() throws SQLException { TestUtil.getConnection(TEST_DATABASE_NAME, "create=true;dataEncryption=true;bootPassword=" + OLD_PASSWORD); }
TestUtil.getConnection(TEST_DATABASE_NAME, "create=true;dataEncryption=true;bootPassword=" + OLD_PASSWORD);
String connAttrs = ""; if (encryptionType == USING_PASSWORD) { connAttrs = "create=true;dataEncryption=true;bootPassword=" + OLD_PASSWORD; } if (encryptionType == USING_KEY) { connAttrs = "create=true;dataEncryption=true;encryptionKey=" + OLD_KEY; } return TestUtil.getConnection(currentTestDatabase, connAttrs);
private void createEncryptedDatabase() throws SQLException { TestUtil.getConnection(TEST_DATABASE_NAME, "create=true;dataEncryption=true;bootPassword=" + OLD_PASSWORD); }
private void encryptDatabase(String password)
private Connection encryptDatabase()
private void encryptDatabase(String password) throws SQLException { //encrypt an existing database. String connAttrs = "dataEncryption=true;bootPassword=" + password ; TestUtil.getConnection(TEST_DATABASE_NAME, connAttrs); }
String connAttrs = "dataEncryption=true;bootPassword=" + password ;
String connAttrs = ""; if (encryptionType == USING_PASSWORD) { connAttrs = "dataEncryption=true;bootPassword=" + OLD_PASSWORD; } if (encryptionType == USING_KEY) { connAttrs = "dataEncryption=true;encryptionKey=" + OLD_KEY; }
private void encryptDatabase(String password) throws SQLException { //encrypt an existing database. String connAttrs = "dataEncryption=true;bootPassword=" + password ; TestUtil.getConnection(TEST_DATABASE_NAME, connAttrs); }
TestUtil.getConnection(TEST_DATABASE_NAME, connAttrs);
if (verbose) logMessage("encrypting " + currentTestDatabase + " with " + connAttrs); return TestUtil.getConnection(currentTestDatabase, connAttrs);
private void encryptDatabase(String password) throws SQLException { //encrypt an existing database. String connAttrs = "dataEncryption=true;bootPassword=" + password ; TestUtil.getConnection(TEST_DATABASE_NAME, connAttrs); }
return rs.getInt(1);
int max = rs.getInt(1); rs.close(); s.close(); return max;
private int findMax(Connection conn, String tableName) throws SQLException { Statement s = conn.createStatement(); ResultSet rs = s.executeQuery("SELECT max(ID) from " + tableName); rs.next(); return rs.getInt(1); }
ps.close();
void insert(Connection conn, String tableName, int rowCount) throws SQLException { PreparedStatement ps = conn.prepareStatement("INSERT INTO " + tableName + " VALUES(?...
private void reEncryptDatabase(String currentPassword, String newPassword) throws SQLException
private Connection reEncryptDatabase() throws SQLException
private void reEncryptDatabase(String currentPassword, String newPassword) throws SQLException { // re-encrypt the database. String connAttrs = "bootPassword=" + currentPassword + ";newBootPassword=" + newPassword; TestUtil.getConnec...
String connAttrs = "bootPassword=" + currentPassword + ";newBootPassword=" + newPassword; TestUtil.getConnection(TEST_DATABASE_NAME, connAttrs);
String connAttrs = ""; if (encryptionType == USING_PASSWORD) { connAttrs = "bootPassword=" + OLD_PASSWORD + ";newBootPassword=" + NEW_PASSWORD; } if (encryptionType == USING_KEY) { connAttrs = "encryptionKey=" + OLD_KEY + ";newEncryptionKey=" + NEW_KEY; } return TestUtil.getConnection(currentTestDatabase, connAttrs...
private void reEncryptDatabase(String currentPassword, String newPassword) throws SQLException { // re-encrypt the database. String connAttrs = "bootPassword=" + currentPassword + ";newBootPassword=" + newPassword; TestUtil.getConnec...
createEncryptedDatabase(); Connection conn = TestUtil.getConnection(TEST_DATABASE_NAME, null); createTable(conn, TEST_TABLE_NAME); insert(conn, TEST_TABLE_NAME, 100); conn.commit(); shutdown(TEST_DATABASE_NAME);
if (SanityManager.DEBUG) { if (verbose) logMessage("Start testing re-encryption with Password"); currentTestDatabase = TEST_REENCRYPT_PWD_DATABASE; encryptionType = USING_PASSWORD; runCrashRecoveryTestCases(true);
private void runTest() throws Exception { logMessage("Begin ReEncryptCrashRecovery Test"); createEncryptedDatabase(); Connection conn = TestUtil.getConnection(TEST_DATABASE_NAME, null); createTable(conn, TEST_TABLE_NAME); //load some rows ...
crashBeforeCommit(); recover_crashBeforeCommit(); shutdown(TEST_DATABASE_NAME);
if (verbose) logMessage("Start Testing encryption with Password");
private void runTest() throws Exception { logMessage("Begin ReEncryptCrashRecovery Test"); createEncryptedDatabase(); Connection conn = TestUtil.getConnection(TEST_DATABASE_NAME, null); createTable(conn, TEST_TABLE_NAME); //load some rows ...
currentTestDatabase = TEST_ENCRYPT_PWD_DATABASE; encryptionType = USING_PASSWORD; runCrashRecoveryTestCases(false); if (verbose) { logMessage("Start Testing Encryption with external Key"); } currentTestDatabase = TEST_ENCRYPT_KEY_DATABASE; encryptionType = USING_KEY; runCrashRecoveryTestCases(false); if (verbose...
private void runTest() throws Exception { logMessage("Begin ReEncryptCrashRecovery Test"); createEncryptedDatabase(); Connection conn = TestUtil.getConnection(TEST_DATABASE_NAME, null); createTable(conn, TEST_TABLE_NAME); //load some rows ...
void shutdown(String dbName) {
void shutdown() {
void shutdown(String dbName) { try{ //shutdown TestUtil.getConnection(dbName, "shutdown=true"); }catch(SQLException se){ if (se.getSQLState() == null || !(se.getSQLState().equals("08006"))) { // database was not shutdown properly dumpSQLException(se); } } }
TestUtil.getConnection(dbName, "shutdown=true");
TestUtil.getConnection(currentTestDatabase, "shutdown=true");
void shutdown(String dbName) { try{ //shutdown TestUtil.getConnection(dbName, "shutdown=true"); }catch(SQLException se){ if (se.getSQLState() == null || !(se.getSQLState().equals("08006"))) { // database was not shutdown properly dumpSQLException(se); } } }
}else {
SQLException ne = sqle.getNextException(); if (ne != null) { String message = ne.getMessage(); if (message.indexOf(debugFlag) != -1) { expectedExcepion = true; } } } if (!expectedExcepion)
private void verifyException(SQLException sqle, String debugFlag) { if (sqle != null) { if (sqle.getSQLState() != null && sqle.getSQLState().equals("XJ040")) { // boot failed as expected with the debug flag }else { ...
} } else {
} else {
private void verifyException(SQLException sqle, String debugFlag) { if (sqle != null) { if (sqle.getSQLState() != null && sqle.getSQLState().equals("XJ040")) { // boot failed as expected with the debug flag }else { ...
unblockBackup();
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(); ...
unblockBackup();
private final void postTermination() throws StandardException { // move all the postTermination work to the postCommit queue int count = (postTerminationWorks == null) ? 0 : postTerminationWorks.size(); for (int i = 0; i < count; i++) addPostCommitWork((Serviceable)postTerminationWorks.get(i)); if (count > 0...
return getRegisteredDriver().acceptsURL(url);
return getDriverModule().acceptsURL(url);
public boolean acceptsURL(String url) throws SQLException { return getRegisteredDriver().acceptsURL(url); }
private static void boot() {
static void boot() {
private static void boot() { PrintStream ps = DriverManager.getLogStream(); if (ps == null) ps = System.err; new JDBCBoot().boot(Attribute.PROTOCOL, ps); }
return getRegisteredDriver().connect(url, info);
return getDriverModule().connect(url, info);
public Connection connect(String url, Properties info) throws SQLException { return getRegisteredDriver().connect(url, info); }
return (getRegisteredDriver().getMajorVersion());
return (getDriverModule().getMajorVersion());
public int getMajorVersion() { try { return (getRegisteredDriver().getMajorVersion()); } catch (SQLException se) { return 0; } }
return (getRegisteredDriver().getMinorVersion());
return (getDriverModule().getMinorVersion());
public int getMinorVersion() { try { return (getRegisteredDriver().getMinorVersion()); } catch (SQLException se) { return 0; } }
return getRegisteredDriver().getPropertyInfo(url, info);
return getDriverModule().getPropertyInfo(url, info);
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { return getRegisteredDriver().getPropertyInfo(url, info); }
return (getRegisteredDriver().jdbcCompliant());
return (getDriverModule().jdbcCompliant());
public boolean jdbcCompliant() { try { return (getRegisteredDriver().jdbcCompliant()); } catch (SQLException se) { return false; } }
sqle.initCause(getCause());
sqle.initCause(this);
public SQLException getSQLException() { if ( wrappedException_ != null ) { return wrappedException_; } // When we have support for JDBC 4 SQLException subclasses, this is // where we decide which exception to create SQLException sqle = ...
if(create) properties.put(Attribute.CRYPTO_KEY_LENGTH,String.valueOf(generatedKey.length)); else if(generatedKey.length != encodedKeyLength && encodedKeyLength > 0) throw StandardException.newException(SQLState.ENCRYPTION_BAD_EXTERNAL_KEY);
public void boot(boolean create, Properties properties) throws StandardException { if (SanityManager.DEBUG) { if (JVMInfo.JDK_ID < 2) SanityManager.THROWASSERT("expected JDK ID to be 2 - is " + JVMInfo.JDK_ID); } boolean provider_or_algo_specified = false; boolean storeProperties = create; String exte...
optimizer.considerCost(this, restrictionList, getCostEstimate(), outerCost);
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...
double memusage = optimizable.memoryUsage( estimatedCost.rowCount() / outerCost.rowCount()); if (memusage > maxMemoryPerTable)
if( ! optimizable.memoryUsageOK( estimatedCost.rowCount() / outerCost.rowCount(), maxMemoryPerTable))
public void considerCost(Optimizable optimizable, OptimizablePredicateList predList, CostEstimate estimatedCost, CostEstimate outerCost) throws StandardException { /* ** Don't consider non-feasible join strategies. */ if ( ! optimizable.feasibleJoinStrategy(predList, this)) { return; } ...
trace(SKIPPING_DUE_TO_EXCESS_MEMORY, 0, 0, memusage, null);
trace(SKIPPING_DUE_TO_EXCESS_MEMORY, 0, 0, 0.0, null);
public void considerCost(Optimizable optimizable, OptimizablePredicateList predList, CostEstimate estimatedCost, CostEstimate outerCost) throws StandardException { /* ** Don't consider non-feasible join strategies. */ if ( ! optimizable.feasibleJoinStrategy(predList, this)) { return; } ...
double memusage = optimizable.memoryUsage( estimatedCost.rowCount() / outerCost.rowCount()); if (memusage > maxMemoryPerTable)
if( ! optimizable.memoryUsageOK( estimatedCost.rowCount() / outerCost.rowCount(), maxMemoryPerTable))
private void costBasedCostOptimizable(Optimizable optimizable, TableDescriptor td, ConglomerateDescriptor cd, OptimizablePredicateList predList, CostEstimate outerCost) throws StandardException { CostEstimate estimatedCost = estimateTotalCost(predList, cd, ...
trace(SKIPPING_DUE_TO_EXCESS_MEMORY, 0, 0, memusage, null);
trace(SKIPPING_DUE_TO_EXCESS_MEMORY, 0, 0, 0.0, null);
private void costBasedCostOptimizable(Optimizable optimizable, TableDescriptor td, ConglomerateDescriptor cd, OptimizablePredicateList predList, CostEstimate outerCost) throws StandardException { CostEstimate estimatedCost = estimateTotalCost(predList, cd, ...
boolean completeCompile(QueryTreeNode qt)
void completeCompile(QueryTreeNode qt)
boolean completeCompile(QueryTreeNode qt) throws StandardException { //if (finished) // throw StandardException.newException(SQLState.LANG_STATEMENT_CLOSED, "completeCompile()"); paramTypeDescriptors = qt.getParameterTypes(); //If the query references a SESSION schema table (temporary or permanent), then mark...
referencesSessionSchema = qt.referencesSessionSchema();
boolean completeCompile(QueryTreeNode qt) throws StandardException { //if (finished) // throw StandardException.newException(SQLState.LANG_STATEMENT_CLOSED, "completeCompile()"); paramTypeDescriptors = qt.getParameterTypes(); //If the query references a SESSION schema table (temporary or permanent), then mark...
return referencesSessionSchema;
return;
boolean completeCompile(QueryTreeNode qt) throws StandardException { //if (finished) // throw StandardException.newException(SQLState.LANG_STATEMENT_CLOSED, "completeCompile()"); paramTypeDescriptors = qt.getParameterTypes(); //If the query references a SESSION schema table (temporary or permanent), then mark...
daemonGroup.setDaemon(true);
private boolean PBinitialize(boolean lite) { if (!lite) { try { daemonGroup = new ThreadGroup("derby.daemons"); } catch (SecurityException se) { } } InputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.DBMS_INFO); engineVersion = ProductVersionHolder.getProductVersionHolderFromMyEn...
System.out.println("SELECT with " + numUnions/100 * 100 + " unions");
private static void largeUnionSelect(Connection con, String viewName, int numUnions) throws Exception { StringBuffer selectSQLBuffer = new StringBuffer("select * from t0 ") ; for (int i = 1; i < numUnions/100;i++) { selectSQLBuffer.append(" UNION ALL (SELECT * FROM " + viewName + ")"); } try { // R...
System.out.println("PASS: Row data check ok");
System.out.println("PASS: " + testName + " Row data check ok");
private static void largeUnionSelect(Connection con, String viewName, int numUnions) throws Exception { StringBuffer selectSQLBuffer = new StringBuffer("select * from t0 ") ; for (int i = 1; i < numUnions/100;i++) { selectSQLBuffer.append(" UNION ALL (SELECT * FROM " + viewName + ")"); } try { // R...
con.close();
private static void largeUnionSelect(Connection con, String viewName, int numUnions) throws Exception { StringBuffer selectSQLBuffer = new StringBuffer("select * from t0 ") ; for (int i = 1; i < numUnions/100;i++) { selectSQLBuffer.append(" UNION ALL (SELECT * FROM " + viewName + ")"); } try { // R...
System.out.println("FAILED QUERY"); do { System.out.println(sqle.getSQLState() + ":" + sqle.getMessage()); sqle = sqle.getNextException(); } while (sqle != null);
reportFailure(testName, sqle);
private static void largeUnionSelect(Connection con, String viewName, int numUnions) throws Exception { StringBuffer selectSQLBuffer = new StringBuffer("select * from t0 ") ; for (int i = 1; i < numUnions/100;i++) { selectSQLBuffer.append(" UNION ALL (SELECT * FROM " + viewName + ")"); } try { // R...
Statement stmt = null; PreparedStatement pstmt = null; String tableName = "t0"; String viewName = "v0"; ij.getPropertyArg(argv); Connection con = ij.startJBMS(); con.setAutoCommit(false); stmt = con.createStatement(); System.out.println("connected"); try { stmt.executeUpdate("drop table " + tableName); }catch (...
ij.getPropertyArg(argv); Connection con = ij.startJBMS(); con.setAutoCommit(false); testParamsInWhereClause(con); testUnions(con); con.commit(); con.close();
public static void main(String argv[]) throws Exception { Statement stmt = null; PreparedStatement pstmt = null; //int numUnions = 4000; //int numUnions = 2000; /* We still have problems with large queries. Passes at 4000. With size 5000 it gets "java.lang.VerifyError: (cla...
System.out.println("Derby boot failed: " + ":" + attrs.getProperty("databaseName"));
System.out.println("Derby boot failed: " + attrs.getProperty("databaseName") + " : " + e.getSQLState() + ": " + e.getMessage());
private static void bootDerby () throws SQLException { Properties attrs = new Properties(); attrs.setProperty("databaseName", makeDatabaseName()); attrs.setProperty("createDatabase", "create"); DataSource ds = TestUtil.getDataSource(attrs); try { Connection conn = ds.getConnection();...
assertEmpty(errStreamFile);
private static void checkField() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FIELD_PROP, "org.apache.derbyTesting.functionTests.tests.lang."+ "errorStream.fieldStream"); ...
assertEmpty(errStreamFile);
private static void checkFile() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FILE_PROP, fileStreamFile.getCanonicalPath()); bootDerby(); shutdownDerby(); closeStreams(); assertNonEmpty(fileSt...
assertEmpty(errStreamFile);
private static void checkFileOverField() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FILE_PROP, fileStreamFile.getCanonicalPath()); sysProps.put(FIELD_PROP, "org.apache.derbyTes...
assertEmpty(errStreamFile);
private static void checkFileOverMethod() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FILE_PROP, fileStreamFile.getCanonicalPath()); sysProps.put(METHOD_PROP, "org.apache.derby...
assertEmpty(errStreamFile);
private static void checkFileOverMethodAndField() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FILE_PROP, fileStreamFile.getCanonical...
assertEmpty(errStreamFile);
private static void checkMethod() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(METHOD_PROP, "org.apache.derbyTesting.functionTests.tests.lang."+ "errorStream.getStream"); ...
assertEmpty(errStreamFile);
private static void checkMethodOverField() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(METHOD_PROP, "org.apache.derbyTesting.functionTests.tests.lang."+ "errorStr...
assertNonEmpty(errStreamFile);
private static void checkWrongField() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(FIELD_PROP, "org.apache.derbyTesting.functionTests.tests.lang."+ "errorStream.nonExis...
assertNonEmpty(errStreamFile);
private static void checkWrongFile() throws AssertException, IOException, SQLException { openStreams(); sysProps.put(FILE_PROP, new File(derbyHome+"foo", // erroneous path makeStreamFilename("file")).getCanonicalPa...
assertNonEmpty(errStreamFile);
private static void checkWrongMethod() throws AssertException, IOException, SQLException { openStreams(); resetProps(); sysProps.put(METHOD_PROP, "org.apache.derbyTesting.functionTests.tests.lang."+ "errorStream.nonE...
System.setErr(System.out);
private static void closeStreams() throws IOException { try { methodStream.close(); fieldStream.close(); } catch (IOException e) { System.out.println("Could not close stream files"); throw e; } }
errStreamFile = new File(derbyHome, makeStreamFilename("err")); errStream =new FileOutputStream(errStreamFile); System.setErr(new PrintStream(errStream));
private static void openStreams() throws IOException{ runNo += 1; try { fileStreamFile = new File(derbyHome, makeStreamFilename("file")); methodStreamFile = new File(derbyHome, makeStreamFilename("method")); methodStream = new FileOutputStream(methodStreamFile); fieldStreamF...
public <T> T createQueryObject(Class<T> ifc) throws SQLException{
public <T extends BaseQuery>T createQueryObject(Class<T> ifc) throws SQLException {
public <T> T createQueryObject(Class<T> ifc) throws SQLException{ throw Util.notImplemented(); }
userSuppliedOptimizerOverrides,
public RealNestedLoopLeftOuterJoinStatistics( int numOpens, int rowsSeen, int rowsFiltered, long constructorTime, long openTime, long nextTime, long closeTime, int resultSetNumber, int rowsSeenLeft, int rowsSeenRight, int rowsReturned, ...
try { s.execute("drop table t1"); } catch (SQLException se) {} try { s.execute("drop procedure za"); } catch (SQLException se) {}
public static void main(String[] args) { Connection con; PreparedStatement ps; Statement s; String nullString = null; System.out.println("Test nullSQLText starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJB...
bootingDictionary.upgradeMakeCatalog(tc, DataDictionary.SYSREQUIREDPERM_CATALOG_NUM);
private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber, String aid) throws StandardException { // Only supports upgrade from Derby 10.0 releases onwards if (fromMajorVersionNumber < DataDictionary.DD_VERSION_CS_10_0) { throw StandardException.newException(SQLState.UPGRADE_UNSUPPORTED, ...
columnInfo[ix].autoincInc != 0,
public void executeConstantAction( Activation activation ) throws StandardException { TableDescriptor td; UUID toid; SchemaDescriptor schemaDescriptor; ColumnDescriptor columnDescriptor; ExecRow template; LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); DataDictionar...
else columnDescriptor = new ColumnDescriptor( columnInfo[ix].name, index++, columnInfo[ix].dataType, columnInfo[ix].defaultValue, columnInfo[ix].defaultInfo, td, defaultUUID, columnInfo[ix].autoincStart, columnInfo[ix].autoincInc );
public void executeConstantAction( Activation activation ) throws StandardException { TableDescriptor td; UUID toid; SchemaDescriptor schemaDescriptor; ColumnDescriptor columnDescriptor; ExecRow template; LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); DataDictionar...
StorageRandomAccessFile newRaf = privGetRandomAccessFile(newFile);
newRaf = privGetRandomAccessFile(newFile);
protected void encryptContainer(BaseContainerHandle handle, String newFilePath) throws StandardException { BasePage page = null; StorageFile newFile = dataFactory.getStorageFactory().newStorageFile(newFilePath); try { long ...
if (newRaf != null) { try { newRaf.close(); }catch (IOException ioe) { newRaf = null; throw StandardException.newException( SQLState.FILE_CONTAINER_EXCEPTION, ioe, newFile); } }
protected void encryptContainer(BaseContainerHandle handle, String newFilePath) throws StandardException { BasePage page = null; StorageFile newFile = dataFactory.getStorageFactory().newStorageFile(newFilePath); try { long ...
return getWholeDigits(decimalValue) + decimalValue.scale();
return SQLDecimal.getWholeDigits(decimalValue) + decimalValue.scale();
private static int getPrecision(BigDecimal decimalValue) { if ((decimalValue == null) || decimalValue.equals(ZERO)) { return 0; } return getWholeDigits(decimalValue) + decimalValue.scale(); }
return getWholeDigits(getBigDecimal());
return SQLDecimal.getWholeDigits(getBigDecimal());
private int getWholeDigits() { return getWholeDigits(getBigDecimal()); }
jira614Test_a(conn);
public static void main (String args[]) { try { System.out.println("prepStmt Test Starts"); ij.getPropertyArg(args); conn = ij.startJBMS(); if (conn == null) { System.out.println("conn didn't work"); return; } Statement cleanstmt = conn.createStatement(); TestUtil.cleanUpTest(cleanstmt, testO...
if (frameworkString == null) { String useprocessFramework = RunTest.framework; if (useprocessFramework != null) frameworkString = useprocessFramework; }
private static int getFramework() { if (framework != UNKNOWN_FRAMEWORK) return framework; String frameworkString = (String) AccessController.doPrivileged (new PrivilegedAction() { public Object run() { return System.getProperty("fra...
ColumnTypeConversionException(LogWriter logWriter) {
ColumnTypeConversionException(LogWriter logWriter, String sourceType, String targetType) {
ColumnTypeConversionException(LogWriter logWriter) { super(logWriter, "Invalid data conversion:" + " Wrong result column type for requested conversion."); }
"Invalid data conversion:" + " Wrong result column type for requested conversion.");
new MessageId(SQLState.LANG_DATA_TYPE_GET_MISMATCH), sourceType, targetType);
ColumnTypeConversionException(LogWriter logWriter) { super(logWriter, "Invalid data conversion:" + " Wrong result column type for requested conversion."); }
public void copyFields(ValueNode oldVN)
public void copyFields(ValueNode oldVN) throws StandardException
public void copyFields(ValueNode oldVN) { dataTypeServices = oldVN.getTypeServices(); typeId = oldVN.getTypeId(); }
public TypeCompiler getTypeCompiler()
public TypeCompiler getTypeCompiler() throws StandardException
public TypeCompiler getTypeCompiler() { if (typeCompiler == null) { /* ** getTypeId() is overriddend by parameter node so ** don't get smart and remove the extra method call. */ typeCompiler = getTypeCompiler(getTypeId()); } return typeCompiler; }
public TypeId getTypeId()
public TypeId getTypeId() throws StandardException
public TypeId getTypeId() { return typeId; }
public DataTypeDescriptor getTypeServices()
public DataTypeDescriptor getTypeServices() throws StandardException
public DataTypeDescriptor getTypeServices() { return dataTypeServices; }
throws StandardException
public double selectivity(Optimizable optTable) { // Return 1 if additional predicates have been generated from this one. if (transformed) { return 1.0; } else { return 0.5d; } }
public void setType(DataTypeDescriptor dataTypeServices)
public void setType(DataTypeDescriptor dataTypeServices) throws StandardException
public void setType(DataTypeDescriptor dataTypeServices) { this.dataTypeServices = dataTypeServices; /* Get this now so we only have to cast it once */ if (dataTypeServices == null) typeId = null; else typeId = dataTypeServices.getTypeId(); // Clear the typeCompiler, just in case type has changed typeCompile...
if ((arg1 instanceof ConstantNode) || (arg1.isParameterNode()))
if ((arg1 instanceof ConstantNode) || (arg1.requiresTypeFromContext()))
private void updateMaps(JBitSet[] tableColMap, boolean[] eqOuterCols, int[] tableNumbers, int tableNumber, int resultTable, ValueNode arg1, ValueNode arg2) throws StandardException { /* arg2 is a column from our table. This * is a good = for both All tables and Outer arrays * if the right side is a constant...
public static void pmap(short in, short[] inout, short[] out) { inout[0] += 6; out[0] = 77;
public static void pmap(BigDecimal in, BigDecimal[] inout, BigDecimal[] out) { inout[0] = inout[0].add(new BigDecimal(2.3)); out[0] = new BigDecimal(84.1);
public static void pmap(short in, short[] inout, short[] out) { inout[0] += 6; out[0] = 77; }
executeQuery, executeUpdate,
boolean executeStatement(Activation a, boolean executeQuery, boolean executeUpdate) throws SQLException { // we don't differentiate the update from the resultset case. // so, there could be a result set. // note: the statement interface will paste together // an activation a...
boolean haveDynamicResults = false;
int dynamicResultCount = 0;
boolean executeStatement(Activation a, boolean executeQuery, boolean executeUpdate) throws SQLException { // we don't differentiate the update from the resultset case. // so, there could be a result set. // note: the statement interface will paste together // an activation a...
haveDynamicResults = processDynamicResults(a.getDynamicResults(), a.getMaxDynamicResults());
dynamicResultCount = processDynamicResults(a.getDynamicResults(), a.getMaxDynamicResults());
boolean executeStatement(Activation a, boolean executeQuery, boolean executeUpdate) throws SQLException { // we don't differentiate the update from the resultset case. // so, there could be a result set. // note: the statement interface will paste together // an activation a...
if (!haveDynamicResults) {
if (dynamicResultCount == 0) {
boolean executeStatement(Activation a, boolean executeQuery, boolean executeUpdate) throws SQLException { // we don't differentiate the update from the resultset case. // so, there could be a result set. // note: the statement interface will paste together // an activation a...
retval = haveDynamicResults;
retval = (dynamicResultCount > 0);
boolean executeStatement(Activation a, boolean executeQuery, boolean executeUpdate) throws SQLException { // we don't differentiate the update from the resultset case. // so, there could be a result set. // note: the statement interface will paste together // an activation a...
private boolean processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException {
private int processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException {
private boolean processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException { EmbedResultSet[] sorted = new EmbedResultSet[holder.length]; int actualCount = 0; for (int i = 0; i < holder.length; i++) { java.sql.ResultSet[] param = holder[i]; if (param[0] == null) contin...
return true;
private boolean processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException { EmbedResultSet[] sorted = new EmbedResultSet[holder.length]; int actualCount = 0; for (int i = 0; i < holder.length; i++) { java.sql.ResultSet[] param = holder[i]; if (param[0] == null) contin...
return false;
return actualCount;
private boolean processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException { EmbedResultSet[] sorted = new EmbedResultSet[holder.length]; int actualCount = 0; for (int i = 0; i < holder.length; i++) { java.sql.ResultSet[] param = holder[i]; if (param[0] == null) contin...
throw SQLExceptionFactory.notImplemented("getClientInfo()");
checkForNullPhysicalConnection(); return physicalConnection_.getClientInfo();
public Properties getClientInfo() throws SQLException { throw SQLExceptionFactory.notImplemented("getClientInfo()"); }
SQLException sqle = SQLExceptionFactory.notImplemented("setClientInfo(Properties)"); throw new ClientInfoException(sqle.getMessage(), sqle.getSQLState(), properties == null ? null : (Properties)properties.clone());
try { checkForNullPhysicalConnection(); } catch (SQLException se) { throw new ClientInfoException (se.getMessage(), se.getSQLState(), (new FailedProperties40(properties)).getProperties()); } physicalConnection_.setClientInfo(properties);
public void setClientInfo(Properties properties) throws ClientInfoException { SQLException sqle = SQLExceptionFactory.notImplemented("setClientInfo(Properties)"); throw new ClientInfoException(sqle.getMessage(), sqle.getSQLState(), ...
ps = null; pmd = null;
protected void tearDown() throws Exception { if(ps != null && !ps.isClosed()) ps.close(); super.tearDown(); }
int offset = origString.indexOf(DERBY_SYSTEM_HOME);
String replaceString = DERBY_SYSTEM_HOME + File.separator; int offset = origString.indexOf(replaceString);
private static String replaceSystemHome(String origString) { int offset = origString.indexOf(DERBY_SYSTEM_HOME); if (offset == -1) return origString; else return origString.substring(0,offset) + "[DERBY_SYSTEM_HOME]"+ origString.substring(offset + DERBY_SYSTEM_HOME.length()); }
return origString.substring(0,offset) + "[DERBY_SYSTEM_HOME]"+ origString.substring(offset + DERBY_SYSTEM_HOME.length());
return origString.substring(0,offset) + "[DERBY_SYSTEM_HOME]/"+ origString.substring(offset + replaceString.length());
private static String replaceSystemHome(String origString) { int offset = origString.indexOf(DERBY_SYSTEM_HOME); if (offset == -1) return origString; else return origString.substring(0,offset) + "[DERBY_SYSTEM_HOME]"+ origString.substring(offset + DERBY_SYSTEM_HOME.length()); }
throws SQLException { throw Util.notImplemented();
throws SQLException { try { return getRealConnection().createArray (typeName, elements); } catch (SQLException sqle) { notifyException(sqle); throw sqle; }
public Array createArray(String typeName, Object[] elements) throws SQLException { throw Util.notImplemented(); }
throw Util.notImplemented();
try { return getRealConnection().createNClob(); } catch (SQLException sqle) { notifyException(sqle); throw sqle; }
public NClob createNClob() throws SQLException{ throw Util.notImplemented(); }
throw Util.notImplemented();
try { return getRealConnection().createSQLXML (); } catch (SQLException sqle) { notifyException(sqle); throw sqle; }
public SQLXML createSQLXML() throws SQLException{ throw Util.notImplemented(); }
throws SQLException { throw Util.notImplemented();
throws SQLException { try { return getRealConnection().createStruct (typeName, attributes); } catch (SQLException sqle) { notifyException(sqle); throw sqle; }
public Struct createStruct(String typeName, Object[] attributes) throws SQLException { throw Util.notImplemented(); }
int getJDBCLevel() { return 4;}
final int getJDBCLevel() { return 4;}
int getJDBCLevel() { return 4;}
public java.util.Map<String,Class<?>> getTypeMap() throws SQLException {
public final java.util.Map<String,Class<?>> getTypeMap() throws SQLException {
public java.util.Map<String,Class<?>> getTypeMap() throws SQLException { try { return getRealConnection().getTypeMap(); } catch (SQLException se) { notifyException(se); throw se; } }
public boolean isWrapperFor(Class<?> interfaces) throws SQLException {
public final boolean isWrapperFor(Class<?> interfaces) throws SQLException {
public boolean isWrapperFor(Class<?> interfaces) throws SQLException { checkIfClosed(); return interfaces.isInstance(this); }
public BrokeredStatement newBrokeredStatement
public final BrokeredStatement newBrokeredStatement
public BrokeredStatement newBrokeredStatement (BrokeredStatementControl statementControl) throws SQLException { return new BrokeredStatement40(statementControl, getJDBCLevel()); }