rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
System.out.print("cs.getBigDecimal=" + cs.getBigDecimal(param) + " was null " + cs.wasNull());
System.out.print("cs.getBigDecimal=" + BigDecimalHandler.getBigDecimalString(cs,param,jdbcType) + " was null " + cs.wasNull());
private static boolean getOutValue(CallableStatement cs, int param, int jdbcType) throws SQLException, IOException { switch (jdbcType) { case Types.BIT: System.out.print("cs.getBoolean=" + cs.getBoolean(param) + " was null " + cs.wasNull()); return true; case Types.TINYINT: System.out.print("cs.getByte=" + c...
System.out.print("getBigDecimal=" + rs.getBigDecimal(1) + " was null " + rs.wasNull());
System.out.print("getBigDecimal=" + BigDecimalHandler.getBigDecimalString(rs,1) + " was null " + rs.wasNull());
private static boolean getValidValue(PreparedStatement ps, int jdbcType) throws SQLException, IOException { ResultSet rs = ps.executeQuery(); rs.next(); switch (jdbcType) { case Types.SMALLINT: System.out.print("getShort=" + rs.getShort(1) + " was null " + rs.wasNull()); return true; case Types.INTEGER: Sy...
{ System.out.print(" getBigDecimal="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getBigDecimal(1)); System.out.print(" was null " + rs.wasNull()); worked = true; } catch (SQLException sqle) { sqleResult = sqle; worked = false; } rs.close();...
if(HAVE_BIG_DECIMAL) { System.out.print(" getBigDecimal="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getBigDecimal(1)); System.out.print(" was null " + rs.wasNull()); worked = true; } catch (SQLException sqle) { sqleResult = sqle; worked =...
private static void getXXX(PreparedStatement ps, int type, boolean isNull) throws SQLException, java.io.IOException { { System.out.print(" getByte="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getByte(1)); System.out.print(" was ...
} catch (SQLException sqle) { sqleResult = sqle; worked = false; } rs.close(); judge_getXXX(worked, sqleResult, 18, type);
} catch (NoSuchMethodError e){ worked = true; System.out.println("ResultSet.getUnicodeStream not present - correct for JSR169"); } catch (SQLException sqle) { sqleResult = sqle; worked = false; } rs.close(); if(TestUtil.HAVE_DRIVER_CLASS) judge_getXXX(worked, sqleResult, 18, type);
private static void getXXX(PreparedStatement ps, int type, boolean isNull) throws SQLException, java.io.IOException { { System.out.print(" getByte="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getByte(1)); System.out.print(" was ...
Object o = rs.getObject(1); Class cgo = B3_GET_OBJECT[type]; String cname; if (cgo.equals(byte[].class)) cname = "byte[]"; else cname = cgo.getName();
private static void getXXX(PreparedStatement ps, int type, boolean isNull) throws SQLException, java.io.IOException { { System.out.print(" getByte="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getByte(1)); System.out.print(" was ...
if (o == null) { msg = "null"; } else if (cgo.isInstance(o)) { msg = "CORRECT :" + cgo.getName(); } else { msg = "FAIL NOT :" + cgo.getName() + " is " + o.getClass().getName();
if(!SQLTypes[type].equals("DECIMAL(10,5)") || HAVE_BIG_DECIMAL) { Object o = rs.getObject(1); Class cgo = B3_GET_OBJECT[type]; String cname; if (cgo.equals(byte[].class)) cname = "byte[]"; else cname = cgo.getName(); if (o == null) { msg = "null"; } else if (cgo.isInstance(o)) { msg = "CORRECT :" + cgo.getName(); } ...
private static void getXXX(PreparedStatement ps, int type, boolean isNull) throws SQLException, java.io.IOException { { System.out.print(" getByte="); ResultSet rs = ps.executeQuery(); rs.next(); boolean worked; SQLException sqleResult = null;; try { System.out.print(rs.getByte(1)); System.out.print(" was ...
String procSQL = "CREATE PROCEDURE PMP.TYPE_AS(" + "IN P1 " + SQLTypes[type] +
String procSQL; if(HAVE_BIG_DECIMAL) { procSQL = "CREATE PROCEDURE PMP.TYPE_AS(" + "IN P1 " + SQLTypes[type] +
public static void main(String[] args) throws Exception { isDB2jNet = TestUtil.isNetFramework(); System.out.println("Test parameterMapping starting"); System.out.println("STILL TO RESOLVE -- Cloudscape getBoolean() allow conversion on strings to match JCC"); System.out.println("STILL TO RESOLVE -- Cloudscape getXX...
System.out.println(procSQL);
} else { procSQL = "CREATE PROCEDURE PMP.TYPE_AS(" + "IN P1 " + SQLTypes[type] + ", INOUT P2 " + SQLTypes[type] + ", OUT P3 " + SQLTypes[type] + ") LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL " + " EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.SimpleProcedureTest.pmap'"; }
public static void main(String[] args) throws Exception { isDB2jNet = TestUtil.isNetFramework(); System.out.println("Test parameterMapping starting"); System.out.println("STILL TO RESOLVE -- Cloudscape getBoolean() allow conversion on strings to match JCC"); System.out.println("STILL TO RESOLVE -- Cloudscape getXX...
s.execute(procSQL);
if (!HAVE_BIG_DECIMAL && SQLTypes[type].equals("DECIMAL(10,5)")) continue; System.out.println(procSQL); s.execute(procSQL);
public static void main(String[] args) throws Exception { isDB2jNet = TestUtil.isNetFramework(); System.out.println("Test parameterMapping starting"); System.out.println("STILL TO RESOLVE -- Cloudscape getBoolean() allow conversion on strings to match JCC"); System.out.println("STILL TO RESOLVE -- Cloudscape getXX...
ps.setBigDecimal(param, new BigDecimal(32.0));
BigDecimalHandler.setBigDecimalString(ps, param, "32.0");
private static boolean setValidValue(PreparedStatement ps, int param, int jdbcType) throws SQLException { switch (jdbcType) { case Types.BIT: ps.setBoolean(param, true); return true; case Types.TINYINT: ps.setByte(param, (byte) 32); return true; case Types.SMALLINT: ps.setShort(param, (short) 32); ret...
}
private static void setXXX(Statement s, PreparedStatement psi, PreparedStatement psq, int type) throws SQLException, java.io.IOException { boolean executeBatchTests = true; // DERBY-349 - Disable executeBatch on these target types as invald conversions // using setByte() and executeBatch lead to the test hanging....
psi.setUnicodeStream(1, new java.io.ByteArrayInputStream(data), 6); psi.executeUpdate(); getValidValue(psq, jdbcTypes[type]); worked = true; } catch (SQLException sqle) { sqleResult = sqle; worked = false; } judge_setXXX(worked, sqleResult, 14, type);
try{ psi.setUnicodeStream(1, new java.io.ByteArrayInputStream(data), 6); } catch (NoSuchMethodError e){ System.out.println("ResultSet.setUnicodeStream not present - correct for JSR169"); } if(TestUtil.HAVE_DRIVER_CLASS){ psi.executeUpdate(); getValidValue(psq, jdbcTypes[type]); } worked = true; } catch (SQLException ...
private static void setXXX(Statement s, PreparedStatement psi, PreparedStatement psq, int type) throws SQLException, java.io.IOException { boolean executeBatchTests = true; // DERBY-349 - Disable executeBatch on these target types as invald conversions // using setByte() and executeBatch lead to the test hanging....
psi.setUnicodeStream(1, null, 0); psi.executeUpdate(); getValidValue(psq, jdbcTypes[type]); worked = true; } catch (SQLException sqle) { sqleResult = sqle; worked = false; } judge_setXXX(worked, sqleResult, 14, type);
try{ psi.setUnicodeStream(1, null, 0); } catch (NoSuchMethodError e){ System.out.println("ResultSet.setUnicodeStream not present - correct for JSR169"); } if(TestUtil.HAVE_DRIVER_CLASS){ psi.executeUpdate(); getValidValue(psq, jdbcTypes[type]); } worked = true; } catch (SQLException sqle) { sqleResult = sqle; worked ...
private static void setXXX(Statement s, PreparedStatement psi, PreparedStatement psq, int type) throws SQLException, java.io.IOException { boolean executeBatchTests = true; // DERBY-349 - Disable executeBatch on these target types as invald conversions // using setByte() and executeBatch lead to the test hanging....
setXXX_setObject(s, psi, psq, type, BigDecimal.valueOf(72L), "java.math.BigDecimal", 1, executeBatchTests);
if(HAVE_BIG_DECIMAL) setXXX_setObject(s, psi, psq, type, BigDecimal.valueOf(72L), "java.math.BigDecimal", 1, executeBatchTests);
private static void setXXX(Statement s, PreparedStatement psi, PreparedStatement psq, int type) throws SQLException, java.io.IOException { boolean executeBatchTests = true; // DERBY-349 - Disable executeBatch on these target types as invald conversions // using setByte() and executeBatch lead to the test hanging....
Logs.reportMessage("CSLOOK_Header", "tables");
Logs.reportMessage("CSLOOK_TablesHeader");
public static void doTables(Connection conn, HashMap tableIdToNameMap) throws SQLException { // Prepare some statements for general use by this class. getColumnInfoStmt = conn.prepareStatement("SELECT C.COLUMNNAME, C.REFERENCEID, " + "C.COLUMNNUMBER FROM SYS.SYSCOLUMNS C, SYS.SYSTABLES T WHERE T.TABLEID = ? " +...
t_setRowId();
void startClientTestMethods( Connection conn_main ) { PreparedStatement ps_main = null; stmtIsClosed = false; try { ps_main = conn_main.prepareStatement("select count(*) from " + "sys.systables"); conn = conn_main; ps = ps_main; ...
t_setRowId();
void startEmbeddedTestMethods( Connection conn_main ) { PreparedStatement ps_main = null; stmtIsClosed = false; try { Statement s = conn_main.createStatement(); s.execute("create table clobtable3 (n int,clobcol CLOB)"); File file = new File("...
public void rememberAsBest(int planType)
public void rememberAsBest(int planType, Optimizer optimizer)
public void rememberAsBest(int planType) throws StandardException { super.rememberAsBest(planType); if (childResult instanceof Optimizable) ((Optimizable) childResult).rememberAsBest(planType); }
super.rememberAsBest(planType);
super.rememberAsBest(planType, optimizer);
public void rememberAsBest(int planType) throws StandardException { super.rememberAsBest(planType); if (childResult instanceof Optimizable) ((Optimizable) childResult).rememberAsBest(planType); }
((Optimizable) childResult).rememberAsBest(planType);
((Optimizable) childResult).rememberAsBest(planType, optimizer);
public void rememberAsBest(int planType) throws StandardException { super.rememberAsBest(planType); if (childResult instanceof Optimizable) ((Optimizable) childResult).rememberAsBest(planType); }
int cl, int vcl, int lvcl)
int cl, int vcl, int lvcl,String colType)
private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); // now insert long values using streams and check them programatically. psi.setAsciiStream(1, new c3AsciiSt...
System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
System.out.print("AS-"+colType+"-" + lvcl + " ");
private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); // now insert long values using streams and check them programatically. psi.setAsciiStream(1, new c3AsciiSt...
System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
System.out.print("CS-"+colType+"-" + lvcl + " ");
private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); // now insert long values using streams and check them programatically. psi.setAsciiStream(1, new c3AsciiSt...
System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
System.out.print("ST-"+colType+"-" + lvcl + " ");
private static void checkAsciiStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); // now insert long values using streams and check them programatically. psi.setAsciiStream(1, new c3AsciiSt...
int cl, int vcl, int lvcl)
int cl, int vcl, int lvcl,String colType)
private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); psi.setCharacterStream(1, new c3Reader(cl), cl); psi.setCharacterStream(2, new c3Reader(vcl), vcl); ps...
System.out.print("AS-LONG VARCHAR-" + lvcl + " ");
System.out.print("AS-"+colType+"-" + lvcl + " ");
private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); psi.setCharacterStream(1, new c3Reader(cl), cl); psi.setCharacterStream(2, new c3Reader(vcl), vcl); ps...
System.out.print("CS-LONG VARCHAR-" + lvcl + " ");
System.out.print("CS-"+colType+"-" + lvcl + " ");
private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); psi.setCharacterStream(1, new c3Reader(cl), cl); psi.setCharacterStream(2, new c3Reader(vcl), vcl); ps...
System.out.print("ST-LONG VARCHAR-" + lvcl + " ");
System.out.print("ST-"+colType+"-" + lvcl + " ");
private static void checkCharacterStreams(PreparedStatement psDel, PreparedStatement psi, PreparedStatement psq2, int cl, int vcl, int lvcl) throws SQLException, java.io.IOException { psDel.executeUpdate(); psi.setCharacterStream(1, new c3Reader(cl), cl); psi.setCharacterStream(2, new c3Reader(vcl), vcl); ps...
setStreams(conn);
setStreams(conn,"LONG VARCHAR"); System.out.println("run test with clob column"); conn.createStatement().executeUpdate("drop table charstream"); conn.createStatement().executeUpdate("create table charstream(id int GENERATED ALWAYS AS IDENTITY primary key, c char(25), vc varchar(32532), lvc clob)"); setStreams(conn,"C...
public static void main(String[] args) { isDerbyNet = TestUtil.isNetFramework(); if (isDerbyNet) { System.out.println("SKIP TEST FOR NOW"); return; } boolean passed = true; Connection conn = null; try { System.out.println("Test characterStreams starting"); // use the ij utility to read the property file...
static void setStreams(Connection conn) throws Exception {
static void setStreams(Connection conn,String colType) throws Exception {
static void setStreams(Connection conn) throws Exception { ResultSet rs; PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)"); PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, c...
System.out.println("\nTest setAsciiStream into LONG VARCHAR");
System.out.println("\nTest setAsciiStream into "+colType);
static void setStreams(Connection conn) throws Exception { ResultSet rs; PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)"); PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, c...
System.out.println("\nTest setCharacterStream into LONG VARCHAR");
System.out.println("\nTest setCharacterStream into "+colType);
static void setStreams(Connection conn) throws Exception { ResultSet rs; PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)"); PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, c...
checkAsciiStreams(psDel, psi, psq2, 18, 104, 67); checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563); checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673); checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700);
checkAsciiStreams(psDel, psi, psq2, 18, 104, 67,colType); checkAsciiStreams(psDel, psi, psq2, 25, 16732, 14563,colType); checkAsciiStreams(psDel, psi, psq2, 1, 32433, 32673,colType); checkAsciiStreams(psDel, psi, psq2, 0, 32532, 32700,colType);
static void setStreams(Connection conn) throws Exception { ResultSet rs; PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)"); PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, c...
checkCharacterStreams(psDel, psi, psq2, 14, 93, 55); checkCharacterStreams(psDel, psi, psq2, 25, 19332, 18733); checkCharacterStreams(psDel, psi, psq2, 1, 32433, 32673); checkCharacterStreams(psDel, psi, psq2, 0, 32532, 32700);
checkCharacterStreams(psDel, psi, psq2, 14, 93, 55,colType); checkCharacterStreams(psDel, psi, psq2, 25, 19332, 18733,colType); checkCharacterStreams(psDel, psi, psq2, 1, 32433, 32673,colType); checkCharacterStreams(psDel, psi, psq2, 0, 32532, 32700,colType);
static void setStreams(Connection conn) throws Exception { ResultSet rs; PreparedStatement psi = conn.prepareStatement("insert into charstream(c, vc, lvc) values(?,?,?)"); PreparedStatement psq = conn.prepareStatement("select id, c, {fn length(c)} AS CLEN, cast (vc as varchar(25)) AS VC, {fn length(vc)} AS VCLEN, c...
TestUtil.dumpSQLExceptions(sqle, !held);
boolean ok = !held; boolean showError = true; if (ok) { if (TestUtil.isEmbeddedFramework()) { if ("XCL16".equals(sqle.getSQLState())) showError = false; } else if (TestUtil.isDerbyNetClientFramework()) { showError = false; } } if (showError) TestUtil.dumpSQLExceptions(sqle, ok); else if (ok) System.out.println("Non-he...
private static void checkHeldRS(Connection conn, Statement s, ResultSet rs) throws SQLException { if (s.getConnection() != conn) System.out.println("FAIL - mismatched statement & Connection"); if (rs.getStatement() != s) { // DERBY-1009 System.out....
if (TestUtil.isDerbyNetClientFramework())
if (TestUtil.isDerbyNetClientFramework()) { System.out.println("DERBY-1025 Call conn.commit to avoid exception with client");
private static void derby966(XADataSource xads) { System.out.println("derby966"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Xid xid = XATestUtil.getXid(996, 9, 48); Connection conn = xac.get...
}
private static void derby966(XADataSource xads) { System.out.println("derby966"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Xid xid = XATestUtil.getXid(996, 9, 48); Connection conn = xac.get...
if (TestUtil.isDerbyNetClientFramework())
if (TestUtil.isDerbyNetClientFramework()) { System.out.println("DERBY-1004 Call conn.close to avoid exception with client");
private static void morph(XADataSource xads) { System.out.println("morph"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Connection conn = xac.getConnection(); /* autocommit off; insert into f...
if (TestUtil.isDerbyNetClientFramework())
if (TestUtil.isDerbyNetClientFramework()) { System.out.println("DERBY-1004 Call conn.rollback to avoid exception with client");
private static void morph(XADataSource xads) { System.out.println("morph"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Connection conn = xac.getConnection(); /* autocommit off; insert into f...
if ((xae.errorCode != XAException.XAER_OUTSIDE) && (xae.errorCode != XAException.XAER_RMFAIL))
if (xae.errorCode != XAException.XAER_OUTSIDE)
private static void morph(XADataSource xads) { System.out.println("morph"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Connection conn = xac.getConnection(); /* autocommit off; insert into f...
}
private static void morph(XADataSource xads) { System.out.println("morph"); try { XAConnection xac = xads.getXAConnection(); XAResource xar = xac.getXAResource(); Connection conn = xac.getConnection(); /* autocommit off; insert into f...
if (td.getTableType() == TableDescriptor.VIEW_TYPE && action != TablePrivilegeInfo.SELECT_ACTION) if (actionAllowed[action]) throw StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED, td.getQualifiedName());
public void bind( TableDescriptor td) throws StandardException { this.td = td; for( int action = 0; action < TablePrivilegeInfo.ACTION_COUNT; action++) { if( columnLists[ action] != null) columnBitSets[action] = columnLists[ action].bindResultColumnsByName( td, (DMLStatementNode) null); } }
((ParameterNode) operand).setDescriptor( DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.VARCHAR));
operand.setType(DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.VARCHAR));
void bindParameter() throws StandardException { /* ** According to the SQL standard, if bit_length has a ? operand, ** its type is bit varying with the implementation-defined maximum length ** for a bit. */ ((ParameterNode) operand).setDescriptor( DataTypeDescriptor.getBuiltInDataTypeDescriptor(Types.VAR...
mapCursorNameToResultSet();
setupCursorNameCacheAndMappings();
void flowExecute(int executeType) throws SqlException { super.checkForClosedStatement(); super.clearWarningsX(); super.checkForAppropriateSqlMode(executeType, sqlMode_); checkThatAllParametersAreSet(); if (sqlMode_ == isUpdate__) { updateCount_ = 0; } else { ...
if (lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CX) || ((!forUpdate) && lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CS)))
if (lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CX)) { lf.unlockGroup(t.getCompatibilitySpace(), container.getUniqueId()); container.setLockingPolicy(NO_LOCK); }else if ((!forUpdate) && lf.isLockHeld(t.getCompatibilitySpace(), t, container.getId(), ContainerLock.CS))
public boolean lockContainer( Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException { Object qualifier = forUpdate ? ContainerLock.CIX : ContainerLock.CIS; // for cursor stability put read locks on a sep...
if (!forUpdate) lf.transfer(t.getCompatibilitySpace(), group, t);
lf.transfer(t.getCompatibilitySpace(), group, t);
public boolean lockContainer( Transaction t, ContainerHandle container, boolean waitForLock, boolean forUpdate) throws StandardException { Object qualifier = forUpdate ? ContainerLock.CIX : ContainerLock.CIS; // for cursor stability put read locks on a sep...
if (scan_state != SCAN_INPROGRESS) throw StandardException.newException( SQLState.AM_SCAN_NOT_POSITIONED); if (!open_conglom.latchPage(scan_position)) { throw StandardException.newException( SQLState.AM_RECORD_NOT_FOUND, open_conglom.getContainer().getId(), new Long(scan_position.current_rh.getId())); } RecordHandle...
fetch(row, true);
public void fetch(DataValueDescriptor[] row) throws StandardException { if (scan_state != SCAN_INPROGRESS) throw StandardException.newException( SQLState.AM_SCAN_NOT_POSITIONED); if (!open_conglom.latchPage(scan_position)) { throw StandardException.newExce...
return "ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN";
return "ABS,ACOS,ASIN,ATAN,CEILING,COS,COT,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,RAND,SIGN,SIN,SQRT,TAN";
public String getNumericFunctions() { return "ABS,ACOS,ASIN,ATAN,CEILING,COS,DEGREES,EXP,FLOOR,LOG,LOG10,MOD,PI,RADIANS,SIN,SQRT,TAN"; }
String definedUserPassword = null, passedUserPassword = null; String userNameProperty = org.apache.derby.iapi.reference.Property.USER_PROPERTY_PREFIX.concat(userName);
String userNameProperty = org.apache.derby.iapi.reference.Property.USER_PROPERTY_PREFIX.concat( userName);
public boolean authenticateUser(String userName, String userPassword, String databaseName, Properties info ) { // let's check if the user has been defined as a valid user of the // JBMS system. // We expect to find and match a System property corresponding to the // credentials pass...
if (definedUserPassword != null) { passedUserPassword = encryptPassword(userPassword);
if (definedUserPassword != null) { if (secMec != SECMEC_USRSSBPWD) { passedUserPassword = encryptPassword(userPassword); } else { definedUserPassword = substitutePassword(userName, definedUserPassword, info, true); passedUserPassword = userPassword; } } else { definedUserPassword = getSystemProperty(userNamePro...
public boolean authenticateUser(String userName, String userPassword, String databaseName, Properties info ) { // let's check if the user has been defined as a valid user of the // JBMS system. // We expect to find and match a System property corresponding to the // credentials pass...
} else { definedUserPassword = getSystemProperty(userNameProperty); passedUserPassword = userPassword; }
if ((definedUserPassword != null) && (secMec == SECMEC_USRSSBPWD)) { definedUserPassword = substitutePassword(userName, definedUserPassword, info, false); } }
public boolean authenticateUser(String userName, String userPassword, String databaseName, Properties info ) { // let's check if the user has been defined as a valid user of the // JBMS system. // We expect to find and match a System property corresponding to the // credentials pass...
bytePasswd = AuthenticationServiceBase.toHexByte(plainTxtUserPassword,0,plainTxtUserPassword.length());
bytePasswd = StringUtil.toHexByte( plainTxtUserPassword,0,plainTxtUserPassword.length());
protected String encryptPassword(String plainTxtUserPassword) { if (plainTxtUserPassword == null) return null; MessageDigest algorithm = null; try { algorithm = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException nsae) { // Ignore as we checked already during service boot-up } algorit...
String hexString = ID_PATTERN_NEW_SCHEME + org.apache.derby.iapi.util.StringUtil.toHexString(encryptVal,0,encryptVal.length);
String hexString = ID_PATTERN_NEW_SCHEME + StringUtil.toHexString(encryptVal,0,encryptVal.length);
protected String encryptPassword(String plainTxtUserPassword) { if (plainTxtUserPassword == null) return null; MessageDigest algorithm = null; try { algorithm = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException nsae) { // Ignore as we checked already during service boot-up } algorit...
throw Util.notImplemented();
try { return getRealConnection().getClientInfo(name); } catch (SQLException se) { notifyException(se); throw se; }
public String getClientInfo(String name) throws SQLException{ throw Util.notImplemented(); }
throws SQLException{ throw Util.notImplemented();
throws SQLException{ try { getRealConnection().setClientInfo(name, value); } catch (SQLException se) { notifyException(se); throw se; }
public void setClientInfo(String name, String value) throws SQLException{ throw Util.notImplemented(); }
FormatableBitSet grantablePermittedColumns = null; FormatableBitSet publicPermittedColumns = null; FormatableBitSet publicPrantablePermittedColumns = null;
public void check( LanguageConnectionContext lcc, String authorizationId, boolean forGrant) throws StandardException { DataDictionary dd = lcc.getDataDictionary(); if( hasPermissionOnTable(dd, authorizationId, forGrant)) return; FormatableBitSet permittedColumns = null; FormatableBitSet grantableP...
"Expected no alloc page change(3).", table_name, num_rows, ret_before[SPACE_INFO_NUM_ALLOC], ret_after[SPACE_INFO_NUM_ALLOC], ret_before, ret_after); } if (ret_after[SPACE_INFO_NUM_FREE] != ret_before[SPACE_INFO_NUM_FREE]) { log_wrong_count( "Expected no free page change(3).",
"Expected no alloc page change(4).", table_name, num_rows, ret_before[SPACE_INFO_NUM_ALLOC], ret_after[SPACE_INFO_NUM_ALLOC], ret_before, ret_after); } if (ret_after[SPACE_INFO_NUM_FREE] > ret_before[SPACE_INFO_NUM_FREE]) { log_wrong_count( "Expected no increase in free pages(4).",
private void checkPurgePhase( Connection conn, boolean create_table, String schemaName, String table_name, int num_rows) throws SQLException { testProgress( "begin checkPurgePhase" + num_rows + " row test, create = " + create_table ...
throw new SqlException(dncLogWriter, "Missing resource bundle: a resource bundle could not be found" + " in the " + Configuration.packageNameForDNC + " package for " + Configuration.dncDriverName);
throw new SqlException(null, new MessageId (SQLState.MISSING_RESOURCE_BUNDLE), Configuration.packageNameForDNC, Configuration.dncDriverName);
public static void checkForExceptionsFromLoadConfiguration(LogWriter dncLogWriter) throws SqlException { if (dncResources__ == null) { throw new SqlException(dncLogWriter, "Missing resource bundle: a resource bundle could not be found" + " in the " + Configura...
throw new SqlException(null, "[derby] " + "PrivilegedActionException:" + e.getException());
throw new SqlException(null, new MessageId (SQLState.ERROR_PRIVILEGED_ACTION), e.getException());
private static void loadProductVersionHolder() throws SqlException { try { dncProductVersionHolder__ = buildProductVersionHolder(); } catch (java.security.PrivilegedActionException e) { throw new SqlException(null, "[derby] " + "PrivilegedAct...
throw new SqlException(null, "[derby] " + "IOException:" + ioe);
throw new SqlException(null, ioe, null);
private static void loadProductVersionHolder() throws SqlException { try { dncProductVersionHolder__ = buildProductVersionHolder(); } catch (java.security.PrivilegedActionException e) { throw new SqlException(null, "[derby] " + "PrivilegedAct...
throw new SqlException(null, "[derby] " + "PrivilegedActionException:" + e.getException());
throw new SqlException(null, new MessageId (SQLState.ERROR_PRIVILEGED_ACTION), e.getException());
private static void loadResources() throws SqlException { try { dncResources__ = (java.util.ResourceBundle) java.security.AccessController.doPrivileged(new org.apache.derby.client.am.GetResourceBundleAction(classNameForResources)); } catch (java.security.PrivilegedActionException e) { ...
"[derby] " + "Missing resource bundle:" + " a resource bundle could not be found" + " in the " + packageNameForDNC + " package for " + Configuration.dncDriverName);
new MessageId (SQLState.MISSING_RESOURCE_BUNDLE), packageNameForDNC, Configuration.dncDriverName);
private static void loadResources() throws SqlException { try { dncResources__ = (java.util.ResourceBundle) java.security.AccessController.doPrivileged(new org.apache.derby.client.am.GetResourceBundleAction(classNameForResources)); } catch (java.security.PrivilegedActionException e) { ...
setElementAt(fromTable.bindNonVTITables(dataDictionary, fromListParam), index);
ResultSetNode newNode = fromTable.bindNonVTITables(dataDictionary, fromListParam); if (fromTable.referencesSessionSchema()) referencesSessionSchema = true; setElementAt(newNode, index);
public void bindTables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException { FromTable fromTable; /* Now we bind the tables - this is a 2 step process. * We first bind all of the non-VTIs, then we bind the VTIs. * This enables us to handle the passing of correlation * colu...
setElementAt(fromTable.bindVTITables(fromListParam), index);
ResultSetNode newNode = fromTable.bindVTITables(fromListParam); if (fromTable.referencesSessionSchema()) referencesSessionSchema = true; setElementAt(newNode, index);
public void bindTables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException { FromTable fromTable; /* Now we bind the tables - this is a 2 step process. * We first bind all of the non-VTIs, then we bind the VTIs. * This enables us to handle the passing of correlation * colu...
if (referencesSessionSchema) return true;
public boolean referencesSessionSchema() throws StandardException { FromTable fromTable; boolean found = false; /* Check for table or VTI name in FROM list */ int size = size(); for (int index = 0; index < size; index++) { fromTable = (FromTable) elementAt(index); if (fromTable.referencesSessionSchema())...
CheckBoxListQuestion question = new CheckBoxListQuestion();
List<Question> quests = section.getQuestions(); CheckBoxListQuestion question = (CheckBoxListQuestion) quests.get(rowId);
public void updateCheckBoxQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCh...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateCheckBoxQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCh...
Question question = new EmptyQuestion();
List<Question> quests = section.getQuestions(); Question question = (EmptyQuestion) quests.get(rowId);
public void updateEmptyQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialChars...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateEmptyQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialChars...
CheckBoxMatrixQuestion question = new CheckBoxMatrixQuestion();
List<Question> quests = section.getQuestions(); CheckBoxMatrixQuestion question = (CheckBoxMatrixQuestion) quests.get(rowId);
public void updateMatrixQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialChar...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateMatrixQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialChar...
NumberListQuestion question = new NumberListQuestion(answers.size());
List<Question> quests = section.getQuestions(); NumberListQuestion question = (NumberListQuestion) quests.get(rowId);
public void updateNumericQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCha...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateNumericQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCha...
question = new TextAreaQuestion();
question = (TextAreaQuestion) quests.get(rowId);
public void updateOpenQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCharsC...
question = new StringQuestion();
question = (StringQuestion) quests.get(rowId);
public void updateOpenQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCharsC...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateOpenQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecialCharsC...
StringListQuestion question = new StringListQuestion();
List<Question> quests = section.getQuestions(); StringListQuestion question = (StringListQuestion) quests.get(rowId);
public void updateStringListQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecial...
List<Question> quests = section.getQuestions(); quests.set(rowId, question);
public void updateStringListQuestionInSection(HttpServletRequest request) { HttpSession session = request.getSession(); Section section = (Section) session.getAttribute("currentSection"); String name = Transformer.htmlEspecialCharsConverter(request .getParameter("name")); String image = Transformer.htmlEspecial...
rowHolder = new TemporaryRowHolderImpl(tc, properties,
rowHolder = new TemporaryRowHolderImpl(activation, properties,
void setup() throws StandardException { // Remember if this is the 1st execution firstExecute = (rc == null); try { //open the source for the parent tables if (numOpens++ == 0) { source.openCore(); } else { source.reopenCore(); } } catch (StandardException se) { activation.checkStateme...
CostEstimate costEstimate = child.getCostEstimate();
CostEstimate costEstimate = child.getFinalCostEstimate();
public void generate(ActivationClassBuilder acb, MethodBuilder mb, ResultSetNode child) throws StandardException { /* ** If sorting is not required, don't generate a sort result set - ** just return the child result set. */ if ( ! sortNeeded) { child.generate(acb, mb); return; } /* Get...
SQLState.LOG_FULL, ioe, null );
SQLState.LOG_FULL, ioe);
private void syncFile( StorageRandomAccessFile raf) throws StandardException { for( int i=0; ; ) { // 3311: JVM sync call sometimes fails under high load against NFS // mounted disk. We re-try to do this 20 times. try { raf.sync( ...
if (positionFromRowLocation) { sourceRow = activation.getExecutionFactory(). getValueRow(indexCols.length); sourceRow.setRowArray(rowArray); boolean row_exists = baseCC.fetch( baseRowLocation, rowArray, (FormatableBitSet) null); if (row_exists) { setCurrentRow(sourceRow); } else { clearCurrentRow(); currentRow = null;...
public ExecRow getCurrentRow() throws StandardException { ExecRow sourceRow = null; if (SanityManager.DEBUG) { SanityManager.ASSERT(isOpen, "IndexRowToBaseRowResultSet is expected to be open"); } if (currentRowPrescanned) return currentRow; /* Nothing to do if we're not currently on a row */ if (curre...
if(grant) routinePermsDesc.setUUID(null);
public void executeGrantRevoke( Activation activation, boolean grant, List grantees) throws StandardException { // Check that the current user has permission to grant the privileges. LanguageConnectionContext lcc = activation.getLanguageConnectionContext(); DataDictionary dd = lcc.getDataDictionary...
throws StandardException
public RoutinePermsDescriptor newRoutinePermsDescriptor( AliasDescriptor ad, String grantor) { return new RoutinePermsDescriptor( dataDictionary, (String) null, grantor, ad.getUUID...
ensureLength(offset_ + 10); org.apache.derby.client.am.DateTime.dateToDateBytes(bytes_, offset_, date); offset_ += 10;
try { ensureLength(offset_ + 10); org.apache.derby.client.am.DateTime.dateToDateBytes(bytes_, offset_, date); offset_ += 10; } catch (java.io.UnsupportedEncodingException e) { throw new SqlException(netAgent_.logWriter_, new MessageId(SQLState.UNSUPPORTED_ENCODING), "java.sql.Date", "DATE", e); }
final void writeDate(java.sql.Date date) throws SqlException { ensureLength(offset_ + 10); org.apache.derby.client.am.DateTime.dateToDateBytes(bytes_, offset_, date); offset_ += 10; }
ensureLength(offset_ + 8); org.apache.derby.client.am.DateTime.timeToTimeBytes(bytes_, offset_, time); offset_ += 8;
try{ ensureLength(offset_ + 8); org.apache.derby.client.am.DateTime.timeToTimeBytes(bytes_, offset_, time); offset_ += 8; } catch(UnsupportedEncodingException e) { throw new SqlException(netAgent_.logWriter_, new MessageId(SQLState.UNSUPPORTED_ENCODING), "java.sql.Time", "TIME", e); }
final void writeTime(java.sql.Time time) throws SqlException { ensureLength(offset_ + 8); org.apache.derby.client.am.DateTime.timeToTimeBytes(bytes_, offset_, time); offset_ += 8; }
ensureLength(offset_ + 26); org.apache.derby.client.am.DateTime.timestampToTimestampBytes(bytes_, offset_, timestamp); offset_ += 26;
try{ ensureLength(offset_ + 26); org.apache.derby.client.am.DateTime.timestampToTimestampBytes(bytes_, offset_, timestamp); offset_ += 26; }catch(UnsupportedEncodingException e) { throw new SqlException(netAgent_.logWriter_, new MessageId(SQLState.UNSUPPORTED_ENCODING), "java.sql.Timestamp", "TIMESTAMP", e); }
final void writeTimestamp(java.sql.Timestamp timestamp) throws SqlException { ensureLength(offset_ + 26); org.apache.derby.client.am.DateTime.timestampToTimestampBytes(bytes_, offset_, timestamp); offset_ += 26; }
void doneScanning(Scan scan, SortBuffer sortBuffer, Vector mergeRuns)
void doneScanning(Scan scan, SortBuffer sortBuffer)
void doneScanning(Scan scan, SortBuffer sortBuffer, Vector mergeRuns) { this.mergeRuns = mergeRuns; doneScanning(scan, sortBuffer); }
this.mergeRuns = mergeRuns;
if (SanityManager.DEBUG) {
void doneScanning(Scan scan, SortBuffer sortBuffer, Vector mergeRuns) { this.mergeRuns = mergeRuns; doneScanning(scan, sortBuffer); }
doneScanning(scan, sortBuffer);
if (this.scan != scan) SanityManager.THROWASSERT("this.scan = " + this.scan + " scan = " + scan); } this.sortBuffer = sortBuffer; this.scan = null; this.state = STATE_DONE_SCANNING;
void doneScanning(Scan scan, SortBuffer sortBuffer, Vector mergeRuns) { this.mergeRuns = mergeRuns; doneScanning(scan, sortBuffer); }
callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK;
callInfo.xaRetVal_ = XAResource.XA_OK;
public void readCommit() throws SqlException { if (isXAConnection_) { // XA Connection int xaState = getXAState(); NetXACallInfo callInfo = xares_.callInfoArray_[currXACallInfoOffset_]; callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK; // initialize XARETVAL if (xa...
if (callInfo.xaRetVal_ != NetXAResource.XARETVAL_XAOK) {
if (callInfo.xaRetVal_ != XAResource.XA_OK) {
public void readCommit() throws SqlException { if (isXAConnection_) { // XA Connection int xaState = getXAState(); NetXACallInfo callInfo = xares_.callInfoArray_[currXACallInfoOffset_]; callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK; // initialize XARETVAL if (xa...
callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK;
callInfo.xaRetVal_ = XAResource.XA_OK;
public void readRollback() throws SqlException { if (isXAConnection_) { // XA connections NetXACallInfo callInfo = xares_.callInfoArray_[currXACallInfoOffset_]; callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK; // initialize XARETVAL readLocalXARollback_(); if (cal...
if (callInfo.xaRetVal_ != NetXAResource.XARETVAL_XAOK) {
if (callInfo.xaRetVal_ != XAResource.XA_OK) {
public void readRollback() throws SqlException { if (isXAConnection_) { // XA connections NetXACallInfo callInfo = xares_.callInfoArray_[currXACallInfoOffset_]; callInfo.xaRetVal_ = NetXAResource.XARETVAL_XAOK; // initialize XARETVAL readLocalXARollback_(); if (cal...
public TypeId(int formatId, BaseTypeIdImpl baseTypeId)
public TypeId(int formatId)
public TypeId(int formatId, BaseTypeIdImpl baseTypeId) { this.formatId = formatId; this.baseTypeId = baseTypeId; setTypeIdSpecificInstanceVariables(); }
this.baseTypeId = baseTypeId;
public TypeId(int formatId, BaseTypeIdImpl baseTypeId) { this.formatId = formatId; this.baseTypeId = baseTypeId; setTypeIdSpecificInstanceVariables(); }
st.execute("create procedure proc1() language java " + "parameter style java dynamic result sets 1 " + "external name 'org.apache.derbyTesting.functionTests." + "tests.jdbcapi.nullSQLText.sp1'");
st.execute("create procedure za() language java external name " + "'org.apache.derbyTesting.functionTests.util.ProcedureTest.zeroArg'" + " parameter style java");
private static void derby522(Statement st) throws Exception { System.out.println("Starting test for DERBY-522."); st.execute("create table t1 (i int)"); st.execute("insert into t1 values 1, 2, 3, 4, 5, 6, 7"); st.execute("create procedure proc1() language java " + "parameter style java dynamic result sets 1 " + ...
" --singleword\ncall proc1()",
" --singleword\ncall za()",
private static void derby522(Statement st) throws Exception { System.out.println("Starting test for DERBY-522."); st.execute("create table t1 (i int)"); st.execute("insert into t1 values 1, 2, 3, 4, 5, 6, 7"); st.execute("create procedure proc1() language java " + "parameter style java dynamic result sets 1 " + ...
OptimizablePredicateList predList);
OptimizablePredicateList predList) throws StandardException;
double nonBasePredicateSelectivity(Optimizable innerTable, OptimizablePredicateList predList);
clientMessageIds.add("J104");
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...