rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
System.out.println("The URL is: " + met.getURL());
try { System.out.println("The URL is: " + met.getURL()); } catch (NoSuchMethodError msme) { System.out.println("DatabaseMetaData.getURL not present - correct for JSR169"); }
public static void main(String[] args) { DatabaseMetaData met; Connection con; Statement s; System.out.println("Test dbMetaDataJdbc30 starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); con = ij.startJBMS(); con.setAutoComm...
return new BigDecimal(((Number) value).doubleValue());
return new BigDecimal(Double.toString(((Number) value).doubleValue()));
public BigDecimal getBigDecimal() throws StandardException { if (! isNull()) { if (value instanceof BigDecimal) return ((BigDecimal)value); if (value instanceof Number) return new BigDecimal(((Number) value).doubleValue()); } return super.getBigDecimal(); }
if(usingDerbyNetClient()) client_ErrorEvent = true;
void raiseErrorEvent() { try { ps_error = conn.prepareStatement("values 1"); //close the connection associated with this prepared statement conn.close(); //Now execute the prepared statement this should cause an error ps_error.execute(); ...
if(ps_close==null || !event.getStatement().equals(ps_close)) { System.out.println("The statement event has the wrong reference + of PreparedStatement");
if(!client_ErrorEvent && (ps_close==null || !event.getStatement().equals(ps_close))) { System.out.println("The statement event has the wrong reference " + "of PreparedStatement"); } if(client_ErrorEvent && (ps_error==null || !event.getStatement().equals(ps_error))) { System.out.println("The statement event has th...
public void statementClosed(StatementEvent event) { statementCloseEventOccurred = true; if(ps_close==null || !event.getStatement().equals(ps_close)) { System.out.println("The statement event has the wrong reference + of PreparedStatement"); } }
Session clientSession = null;
public void run() { Socket clientSocket = null; Session clientSession = null; for (;;) { try { try{ clientSocket = (Socket) AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws IOException { return serverSocket.acc...
clientSession = new Session(connNum, clientSocket, parent.getTraceDirectory(), parent.getTraceAll());
parent.addSession(connNum, clientSocket);
public void run() { Socket clientSocket = null; Session clientSession = null; for (;;) { try { try{ clientSocket = (Socket) AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws IOException { return serverSocket.acc...
parent.addToSessionTable(new Integer(connNum), clientSession); if (parent.getFreeThreads() == 0 && (parent.getMaxThreads() == 0 || parent.getThreadList().size() < parent.getMaxThreads())) { DRDAConnThread thread = new DRDAConnThread(clientSession, parent, timeSlice, parent.getLogConnections()); parent.getThreadList...
public void run() { Socket clientSocket = null; Session clientSession = null; for (;;) { try { try{ clientSocket = (Socket) AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws IOException { return serverSocket.acc...
clientMessageIds.add(SQLState.LANG_RETURN_OUTPUT_PARAM_CANNOT_BE_SET);
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...
throws StandardException
public boolean defaultTypeIsValid(TypeId columnType, DataTypeDescriptor columnDesc, TypeId defaultType, ValueNode defaultNode, String defaultText) { if (defaultText.length() > Limits.DB2_CHAR_MAXWIDTH) // DB2 spec says this isn't allowed. return false; /* We can use info about the way the parser works * to gu...
checkJBMSToString();
if (testConnectionToString) checkJBMSToString();
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
checkToString(dscs);
if (testConnectionToString) checkToString(dscs);
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
DataSource dssimple = TestUtil.getSimpleDataSource(attrs); ds = dssimple; checkConnection("SimpleDataSource", ds.getConnection());
DataSource dssimple = null; if (testSimpleDataSource) { dssimple = TestUtil.getSimpleDataSource(attrs); ds = dssimple; checkConnection("SimpleDataSource", ds.getConnection()); }
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
checkToString(dsp);
if (testConnectionToString) checkToString(dsp);
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
if (needRollbackBeforePCGetConnection) c1.rollback();
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
checkToString(dsx);
if (testConnectionToString) checkToString(dsx);
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
ds = dssimple; checkConnection("EmbeddedSimpleDataSource", dssimple.getConnection());
if(TestUtil.isEmbeddedFramework()) { ds = dssimple; checkConnection("EmbeddedSimpleDataSource", dssimple.getConnection()); }
protected void runTest(String[] args) throws Exception { // Check the returned type of the JDBC Connections. ij.getPropertyArg(args); Connection dmc = ij.startJBMS(); dmc.createStatement().executeUpdate("create table y(i int)"); dmc.createStatement().executeUpdate("create procedure checkConn2(in dsname varchar(20...
self.setStream(stream);
self.setValue(stream, streamValueLength);
public final Object cloneObject() { if (stream == null) return getClone(); SQLBinary self = (SQLBinary) getNewNull(); self.setStream(stream); return self; }
int sz = BASE_MEMORY_USAGE; if( null != dataValue) sz += dataValue.length; return sz;
if (dataValue == null) { if (streamValueLength>=0) { return BASE_MEMORY_USAGE + streamValueLength; } else { return getMaxMemoryUsage(); } } else { return BASE_MEMORY_USAGE + dataValue.length; }
public int estimateMemoryUsage() { int sz = BASE_MEMORY_USAGE; if( null != dataValue) sz += dataValue.length; return sz; } // end of estimateMemoryUsage
bindTables(dataDictionary);
getCompilerContext().pushCurrentPrivType(getPrivType()); try { bindTables(dataDictionary);
public QueryTreeNode bind(DataDictionary dataDictionary) throws StandardException { /* ** Bind the tables before binding the expressions, so we can ** use the results of table binding to look up columns. */ bindTables(dataDictionary); /* Bind the expressions */ bindExpressions(); return this; }
bindExpressions();
bindExpressions(); } finally { getCompilerContext().popCurrentPrivType(); }
public QueryTreeNode bind(DataDictionary dataDictionary) throws StandardException { /* ** Bind the tables before binding the expressions, so we can ** use the results of table binding to look up columns. */ bindTables(dataDictionary); /* Bind the expressions */ bindExpressions(); return this; }
if (sqleResult == null)
msg = checkForInvalidConversion(sqleResult); if (msg == null)
private static void judge_setObject(boolean worked, SQLException sqleResult, int b5o, int type) { String msg; if (worked && B5[b5o][type]) msg = " JDBC MATCH(OK)"; else if (worked) msg = " CLOUD EXT (OK)"; else if (B5[b5o][type]) { if (sqleResult != null) showException(sqleResult); msg = " JDBC FAIL " +...
if ("22005".equals(sqleResult.getSQLState()) || "XCL12".equals(sqleResult.getSQLState())) System.out.print("IC"); else if (sqleResult.getMessage().indexOf("Illegal Conv") != -1) System.out.print("IC"); else showException(sqleResult); msg = " JDBC MATCH (INVALID)";
private static void judge_setObject(boolean worked, SQLException sqleResult, int b5o, int type) { String msg; if (worked && B5[b5o][type]) msg = " JDBC MATCH(OK)"; else if (worked) msg = " CLOUD EXT (OK)"; else if (B5[b5o][type]) { if (sqleResult != null) showException(sqleResult); msg = " JDBC FAIL " +...
if (sqleResult == null)
msg = checkForInvalidConversion(sqleResult); if (msg == null)
private static void judge_setXXX(boolean worked, SQLException sqleResult, int whichCall, int type) { String msg; if (worked && B2_MOD[whichCall][type]) msg = " JDBC MATCH(OK)"; else if (worked) msg = " CLOUD EXT (OK)"; else if (B2_MOD[whichCall][type]) { if (sqleResult != null) showException(sqleResult); ...
if ("22005".equals(sqleResult.getSQLState()) || "XCL12".equals(sqleResult.getSQLState())) System.out.print("IC"); else if (sqleResult.getMessage().indexOf("Illegal Conv") != -1) System.out.print("IC"); else showException(sqleResult); msg = " JDBC MATCH (INVALID)";
private static void judge_setXXX(boolean worked, SQLException sqleResult, int whichCall, int type) { String msg; if (worked && B2_MOD[whichCall][type]) msg = " JDBC MATCH(OK)"; else if (worked) msg = " CLOUD EXT (OK)"; else if (B2_MOD[whichCall][type]) { if (sqleResult != null) showException(sqleResult); ...
boolean executeBatchTests = true; if (TestUtil.isDerbyNetClientFramework()) { switch (jdbcTypes[type]) { case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.DATE: case Types.TIMESTAMP: case Types.TIME: case Types.CLOB: case Types.BLOB: executeBatchTests = false; break; } }
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....
if (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....
setXXX_setObject(s, psi, psq, type, "46", "java.lang.String", 0, executeBatchTests);
setXXX_setObject(s, psi, psq, type, "46", "java.lang.String", 0);
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); setXXX_setObject(s, psi, psq, type, Boolean.TRUE, "java.lang.Boolean", 2, executeBatchTests); setXXX_setObject(s, psi, psq, type, new Integer(74), "java.lang.Integer", 3, executeBatchTests); setXXX_setObject(s, p...
setXXX_setObject(s, psi, psq, type, BigDecimal.valueOf(72L), "java.math.BigDecimal", 1); setXXX_setObject(s, psi, psq, type, Boolean.TRUE, "java.lang.Boolean", 2); setXXX_setObject(s, psi, psq, type, new Integer(74), "java.lang.Integer", 3); setXXX_setObject(s, psi, psq, type, new Long(79), "java.lang.Long", 4); setXXX...
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, data, "byte[]", 7, executeBatchTests); } setXXX_setObject(s, psi, psq, type, java.sql.Date.valueOf("2004-02-14"), "java.sql.Date", 8, executeBatchTests); setXXX_setObject(s, psi, psq, type, java.sql.Time.valueOf("13:26:42"), "java.sql.Time", 9, executeBatchTests); setXXX_setObject(...
setXXX_setObject(s, psi, psq, type, data, "byte[]", 7); } setXXX_setObject(s, psi, psq, type, java.sql.Date.valueOf("2004-02-14"), "java.sql.Date", 8); setXXX_setObject(s, psi, psq, type, java.sql.Time.valueOf("13:26:42"), "java.sql.Time", 9); setXXX_setObject(s, psi, psq, type, java.sql.Timestamp.valueOf("2004-02-23...
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, tester, "java.sql.Blob", 11, executeBatchTests);
setXXX_setObject(s, psi, psq, type, tester, "java.sql.Blob", 11);
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, tester, "java.sql.Clob", 12, executeBatchTests);
setXXX_setObject(s, psi, psq, type, tester, "java.sql.Clob", 12);
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....
private static void setXXX_setObject(Statement s, PreparedStatement psi, PreparedStatement psq, int type, Object value, String className, int b5o, boolean executeBatchTests)
private static void setXXX_setObject(Statement s, PreparedStatement psi, PreparedStatement psq, int type, Object value, String className, int b5o)
private static void setXXX_setObject(Statement s, PreparedStatement psi, PreparedStatement psq, int type, Object value, String className, int b5o, boolean executeBatchTests) throws SQLException, java.io.IOException { { s.execute("DELETE FROM PM.TYPE_AS"); SQLException sqleResult = null; boolean worked; try { ...
if (executeBatchTests) {
{
private static void setXXX_setObject(Statement s, PreparedStatement psi, PreparedStatement psq, int type, Object value, String className, int b5o, boolean executeBatchTests) throws SQLException, java.io.IOException { { s.execute("DELETE FROM PM.TYPE_AS"); SQLException sqleResult = null; boolean worked; try { ...
if (SanityManager.DEBUG) SanityManager.ASSERT(currentRow != null, "No target row when there is a cursor row");
if (rowLocation == null || (cursorRow != null && currentRow == null)) { activation.addWarning(StandardException. newWarning(SQLState.CURSOR_OPERATION_CONFLICT)); return null; }
public ExecRow getNextRowCore() throws StandardException { if ( isOpen ) { if ( ! next ) { next = true; if (SanityManager.DEBUG) SanityManager.ASSERT(! cursor.isClosed(), "cursor closed"); ExecRow cursorRow = cursor.getCurrentRow(); // requalify the current row if (cursorRow == nul...
return new RAFContainer(this);
return rafContainerFactory.newRAFContainer(this);
Cacheable newContainerObject() { if( supportsRandomAccess) return new RAFContainer(this); else return new InputStreamContainer( this); }
StorageFile[] oldFiles = new StorageFile[files.length]; int count = 0;
oldFiles = new StorageFile[files.length]; noOldFiles = 0;
public void encryptAllContainers(RawTransaction t) throws StandardException { /* * List of containers that needs to be encrypted are identified by * simply reading the list of files in seg0. */ String[] files = dataFactory.getContainerNames(); if (files != null) { StorageFile[] oldF...
oldFiles[count++] = encryptContainer(t, ckey);
oldFiles[noOldFiles++] = encryptContainer(t, ckey);
public void encryptAllContainers(RawTransaction t) throws StandardException { /* * List of containers that needs to be encrypted are identified by * simply reading the list of files in seg0. */ String[] files = dataFactory.getContainerNames(); if (files != null) { StorageFile[] oldF...
Serviceable removeOldFiles = new RemoveFiles(oldFiles, count); t.addPostCommitWork(removeOldFiles);
public void encryptAllContainers(RawTransaction t) throws StandardException { /* * List of containers that needs to be encrypted are identified by * simply reading the list of files in seg0. */ String[] files = dataFactory.getContainerNames(); if (files != null) { StorageFile[] oldF...
val = p.getProperty(Property.DRDA_PROP_PORTNUMBER); out.println( "<h4>"+localUtil.getTextMessage("SRV_PortNumber", val)+"</h4>");
private void displayCurrentStatus(HttpServletRequest request, LocalizedResource localUtil, String returnMessage) { try { printAsContentHeader(localUtil.getTextMessage("SRV_Started")); Properties p = server.getCurrentProperties(); String val = p.getProperty(Property.DRDA_PROP_LOGCONNECTIONS); if (val.equals("...
"id='tracedir' value=''>");
"id='tracedir' value='"+tracingDirectory+"'>");
public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String logOnMessage; String logOffMessage; String traceOnMessage; String traceOffMessage; String traceOnOffMessage; String startMessage; String stopMessage; String returnMessage; String ...
lang = lang.trim();
lang = fixLanguageCode(lang.trim());
private String getLocStringFromLanguage(String lang) { int semi; // Cut off any q-value that might come after a semi-colon if ((semi = lang.indexOf(';')) != -1) { lang = lang.substring(0, semi); } // trim any whitespace lang = lang.trim(); return lang; }
String tracingDirectory = config.getInitParameter("tracingDirectory");
this.tracingDirectory = config.getInitParameter("tracingDirectory"); if ( this.tracingDirectory == null ) { this.tracingDirectory = ""; }
public void init(ServletConfig config) throws ServletException { LocalizedResource langUtil = new LocalizedResource(null,null,SERVLET_PROP_MESSAGES); String port = config.getInitParameter("portNumber"); if (port != null) { int p = Integer.valueOf(port).intValue(); if (p > 0) portNumber = p; } String t...
if (server == null)
if (server == null) {
public void init(ServletConfig config) throws ServletException { LocalizedResource langUtil = new LocalizedResource(null,null,SERVLET_PROP_MESSAGES); String port = config.getInitParameter("portNumber"); if (port != null) { int p = Integer.valueOf(port).intValue(); if (p > 0) portNumber = p; } String t...
if ( ! this.tracingDirectory.trim().equals("")) { server.setTraceDirectory(this.tracingDirectory); } }
public void init(ServletConfig config) throws ServletException { LocalizedResource langUtil = new LocalizedResource(null,null,SERVLET_PROP_MESSAGES); String port = config.getInitParameter("portNumber"); if (port != null) { int p = Integer.valueOf(port).intValue(); if (p > 0) portNumber = p; } String t...
this.tracingDirectory = traceDirectory;
private boolean traceDirectory(LocalizedResource localUtil, String traceDirectory, HttpServletRequest request, String returnMessage) { boolean retval = false; if ((traceDirectory == null) || traceDirectory.equals("")) { printErrorForm(localUtil, request, localUtil.getTextMessage("SRV_MissingParam", localUti...
if (knownLang[i].toUpperCase(Locale.ENGLISH).equals(lang.toUpperCase(Locale.ENGLISH)))
if (knownLang[i].equals(lang))
private int translationAvailable(String lang) { for (int i = 0; i < knownLang.length; i++) if (knownLang[i].toUpperCase(Locale.ENGLISH).equals(lang.toUpperCase(Locale.ENGLISH))) return i; return -1; }
checkCancellationFlag();
public ExecRow getNextRowCore() throws StandardException { if (currentRow == null) { currentRow = getCompactRow(candidate, accessedCols, (FormatableBitSet) null, isKeyed); } beginTime = getCurrentTimeMillis(); ExecRow result = null; /* beetle 3865, updateable cursor using index. We first saved updated rows ...
javaPath = "org.apache.derbyTesting." + testDirName;
javaPath = "org.apache.derbyTesting.functionTests.tests." + testDirName;
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing String olduserdir = (String)sysProp.get("user.dir"); Properties ptmp = System.getPropertie...
if (junitxasingle != null) jvmProps.addElement ("junit.xa.single=" + junitxasingle);
private static void runTests(Properties suiteProps, String suite) throws IOException, Exception { // save a copy of the system properties at this point; when runing with // java threads we need to reset the system properties to this list; // otherwise we start to accumulate extraneous properti...
junitxasingle = suiteProperties.getProperty("junit.xa.single");
private static void setTopSuiteProperties() throws ClassNotFoundException, IOException { framework = suiteProperties.getProperty("framework"); jversion = suiteProperties.getProperty("jversion"); //System.out.println("RunList top jversion= " + jversion); jvmName = suiteProperties.getProperty("jvm")...
ExecRow result = null;
final ExecRow result;
public ExecRow doBaseRowProjection(ExecRow sourceRow) throws StandardException { ExecRow result = null; if (source instanceof ProjectRestrictResultSet) { ProjectRestrictResultSet prs = (ProjectRestrictResultSet) source; result = prs.doBaseRowProjection(sourceRow); } else { result = sourceRow.getClone(); } ...
result = sourceRow.getClone();
result = sourceRow.getNewNullRow(); result.setRowArray(sourceRow.getRowArray());
public ExecRow doBaseRowProjection(ExecRow sourceRow) throws StandardException { ExecRow result = null; if (source instanceof ProjectRestrictResultSet) { ProjectRestrictResultSet prs = (ProjectRestrictResultSet) source; result = prs.doBaseRowProjection(sourceRow); } else { result = sourceRow.getClone(); } ...
public SqlException(LogWriter logWriter, ErrorKey errorKey) { super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) + ResourceUtilities.getResource(errorKey.getResourceKey()), errorKey.getSQLState(), errorKey.getErrorCode()); if (logWriter != null) { logWriter.traceDiagnosable(this); }
public SqlException(LogWriter logwriter, MessageId msgid, Object[] args, Throwable cause) { this( logwriter, msgutil_.getCompleteMessage( msgid.msgid, args), ExceptionUtil.getSQLStateFromIdentifier(msgid.msgid), ExceptionUtil.getSeverityFromIdentifier(msgid.msgid));
public SqlException(LogWriter logWriter, ErrorKey errorKey) { super(ResourceUtilities.getResource(ResourceKeys.driverOriginationIndicator) + ResourceUtilities.getResource(errorKey.getResourceKey()), errorKey.getSQLState(), errorKey.getErrorCode()); if (logW...
String message; if (sqlca_ == null) { message = super.getMessage(); } else { message = ((Sqlca) sqlca_).getJDBCMessage();
if (sqlca_ != null) { message_ = ((Sqlca) sqlca_).getJDBCMessage();
public String getMessage() { String message; if (sqlca_ == null) { message = super.getMessage(); } else { message = ((Sqlca) sqlca_).getJDBCMessage(); } if (batchPositionLabel_ == null) { return message; } return batchPositionLabel_ +...
return message;
return message_;
public String getMessage() { String message; if (sqlca_ == null) { message = super.getMessage(); } else { message = ((Sqlca) sqlca_).getJDBCMessage(); } if (batchPositionLabel_ == null) { return message; } return batchPositionLabel_ +...
return batchPositionLabel_ + message;
return batchPositionLabel_ + message_;
public String getMessage() { String message; if (sqlca_ == null) { message = super.getMessage(); } else { message = ((Sqlca) sqlca_).getJDBCMessage(); } if (batchPositionLabel_ == null) { return message; } return batchPositionLabel_ +...
} else if(srcTypeId.isStringTypeId()) { length = opndType.getMaximumWidth(); if (this.targetCharType == Types.CHAR) length = Math.min(length, Limits.DB2_CHAR_MAXWIDTH); else if (this.targetCharType == Types.VARCHAR) length = Math.min(length, Limits.DB2_VARCHAR_MAXWIDTH);
public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { castOperand = castOperand.bindExpression( fromList, subqueryList, aggregateVector); if (castTarget == null) //CHAR or VARCHAR function without specifying target ...
private static void callGetMethod(CallableStatement cs, int arg, int type, StringBuffer strbuf) throws Throwable
private static void callGetMethod(CallableStatement cs, int arg, int type, int paramType ,StringBuffer strbuf) throws Throwable
private static void callGetMethod(CallableStatement cs, int arg, int type, StringBuffer strbuf) throws Throwable { switch (type) { case Types.BIT: case JDBC30Translation.SQL_TYPES_BOOLEAN: strbuf.append("getBoolean("+arg+") = "); strbuf.append(cs.getBoolean(arg)); break; case Types.TINYINT: strbuf...
BigDecimal bd = cs.getBigDecimal(arg); strbuf.append(bd == null ? "null" : bd.toString());
strbuf.append(BigDecimalHandler.getBigDecimalString(cs,arg,paramType));
private static void callGetMethod(CallableStatement cs, int arg, int type, StringBuffer strbuf) throws Throwable { switch (type) { case Types.BIT: case JDBC30Translation.SQL_TYPES_BOOLEAN: strbuf.append("getBoolean("+arg+") = "); strbuf.append(cs.getBoolean(arg)); break; case Types.TINYINT: strbuf...
BigDecimal bd = new BigDecimal("666.666"); cs.setBigDecimal(arg, bd);
BigDecimalHandler.setBigDecimalString(cs,arg,"666.666");
private static void callSetMethod(CallableStatement cs, int arg, int type, StringBuffer strbuf) throws Throwable { switch (type) { case Types.BIT: case JDBC30Translation.SQL_TYPES_BOOLEAN: strbuf.append("setBoolean("+arg+", true)"); cs.setBoolean(arg, true); break; case Types.TINYINT: strbuf.appen...
BigDecimal bd = new BigDecimal("666.666"); cs.setObject(arg, bd);
BigDecimalHandler.setObjectString(cs,arg,"666.666");
private static void callSetObject(CallableStatement cs, int arg, int type, StringBuffer strbuf) throws Throwable { switch (type) { case Types.BIT: case JDBC30Translation.SQL_TYPES_BOOLEAN: strbuf.append("setObject("+arg+", true)"); cs.setObject(arg, new Boolean(true)); break; case Types.TINYINT: s...
test5116(conn);
if(HAVE_DRIVER_CLASS) test5116(conn);
public static void runTests( Connection conn) throws Throwable { conn.setAutoCommit(false); testMisc(conn); testNull(conn); testUpdate(conn); testEachOutputType(conn); testReturnTypes(conn); testOtherOutputType(conn); testManyOut(conn); test5116(conn); }
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.doInsertion'" +
"EXTERNAL NAME '" + CLASS_NAME + "doInsertion'" +
private static void test5116(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING FIX OF 5116 -- VAR BIT VARYING INPUT"); System.out.println("==============================================\n"); Statement stmt = conn.createStatement();...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams." + methodName +
"EXTERNAL NAME '" + CLASS_NAME + "" + methodName +
private static void testEachOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING NORMAL OUTPUT PARAMETERS"); System.out.println("==============================================\n"); CallableStatement cs = null; for (int doS...
else str = "{call "+methodName+"(?,?)}";
private static void testEachOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING NORMAL OUTPUT PARAMETERS"); System.out.println("==============================================\n"); CallableStatement cs = null; for (int doS...
callGetMethod(cs, 1, types[getType], getbuf);
callGetMethod(cs, 1, types[getType], paramJDBCType[method], getbuf);
private static void testEachOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING NORMAL OUTPUT PARAMETERS"); System.out.println("==============================================\n"); CallableStatement cs = null; for (int doS...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.output' NO SQL LANGUAGE JAVA PARAMETER STYLE JAVA");
"EXTERNAL NAME '" + CLASS_NAME + "output' NO SQL LANGUAGE JAVA PARAMETER STYLE JAVA");
private static void testManyOut(Connection conn) throws SQLException { System.out.println("start testManyOut"); Statement scp = conn.createStatement(); scp.execute("CREATE PROCEDURE OP_OUT " + "(OUT I1 INT, OUT I2 INT, OUT I3 INT, OUT I4 INT, OUT I5 INT, "+ "OUT V1 VARCHAR(40), OUT V2 VARCHAR(40), OUT V3 VARCHA...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.takesString'" +
"EXTERNAL NAME '" + CLASS_NAME + "takesString'" +
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
scp.execute("CREATE FUNCTION returnsBigDecimal(P2 INT) RETURNS DECIMAL(10,2) " + "EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.returnsBigDecimal'" +
scp.execute("CREATE FUNCTION returnsString(P2 INT) RETURNS VARCHAR(40) " + "EXTERNAL NAME '" + CLASS_NAME + "returnsString'" +
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
cs = conn.prepareCall("? = call returnsBigDecimal(?)");
cs = conn.prepareCall("? = call returnsString(?)");
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
cs.setBigDecimal(1, new BigDecimal(1d)); System.out.println("ERROR: setBigDecimal() on return output parameter succeeded");
cs.setString(1, new String("test")); System.out.println("ERROR: setString() on return output parameter succeeded");
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
System.out.println("Expected exception on setBigDecimal() on a return output param: "+se);
System.out.println("Expected exception on setString() on a return output param: "+se);
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
scp.execute("DROP FUNCTION returnsBigDecimal");
scp.execute("DROP FUNCTION returnsString");
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.returnsNothing'" +
"EXTERNAL NAME '" + CLASS_NAME + "returnsNothing'" +
private static void testMisc(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING BOUNDARY CONDITIONS"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CRE...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.testNullBug4317'" +
"EXTERNAL NAME '" + CLASS_NAME + "testNullBug4317'" +
private static void testNull(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING NULLS"); System.out.println("==============================================\n"); System.out.println("Test for bug 4317, passing null value for a paramet...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams." + methodName +
"EXTERNAL NAME '" + CLASS_NAME + "" + methodName +
private static void testOtherOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING OUTPUT PARAMETERS WITH register(OTHER)"); System.out.println("==============================================\n"); CallableStatement cs = null...
else str = "{call "+methodName+"(?,?)}";
private static void testOtherOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING OUTPUT PARAMETERS WITH register(OTHER)"); System.out.println("==============================================\n"); CallableStatement cs = null...
callGetMethod(cs, 1, types[getType], getbuf);
callGetMethod(cs, 1, types[getType], Types.OTHER , getbuf);
private static void testOtherOutputType(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING OUTPUT PARAMETERS WITH register(OTHER)"); System.out.println("==============================================\n"); CallableStatement cs = null...
" EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams." + methodName +
" EXTERNAL NAME '" + CLASS_NAME + "" + methodName +
private static void testReturnTypes(Connection conn) throws Throwable { System.out.println("==============================================\n"); System.out.println("TESTING RETURN OUTPUT PARAMETERS"); System.out.println("==============================================\n"); CallableStatement cs = null; for (int meth...
callGetMethod(cs, 1, types[getType], getbuf);
callGetMethod(cs, 1, types[getType], paramJDBCType[method], getbuf);
private static void testReturnTypes(Connection conn) throws Throwable { System.out.println("==============================================\n"); System.out.println("TESTING RETURN OUTPUT PARAMETERS"); System.out.println("==============================================\n"); CallableStatement cs = null; for (int meth...
"EXTERNAL NAME 'org.apache.derbyTesting.functionTests.tests.lang.outparams.returnsIntegerP'" +
"EXTERNAL NAME '" + CLASS_NAME + "returnsIntegerP'" +
private static void testUpdate(Connection conn) throws Throwable { System.out.println("=============================================="); System.out.println("TESTING UPDATE COUNT"); System.out.println("==============================================\n"); Statement scp = conn.createStatement(); scp.execute("CREATE F...
NetSqlca sqlca = parseAbnormalEndUow(resultSetI.getConnectionCallbackInterface());
NetSqlca sqlca = parseAbnormalEndUow(resultSetI);
void parseCloseError(ResultSetCallbackInterface resultSetI) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(resultSetI.getConnectionCallbackInterface()); resultS...
NetSqlca sqlca = parseAbnormalEndUow(resultSetI.getConnectionCallbackInterface());
NetSqlca sqlca = parseAbnormalEndUow(resultSetI);
void parseFetchError(ResultSetCallbackInterface resultSetI) throws DisconnectException { int peekCP = peekCodePoint(); switch (peekCP) { case CodePoint.ABNUOWRM: { NetSqlca sqlca = parseAbnormalEndUow(resultSetI.getConnectionCallbackInterface()); resultS...
public boolean isWrapperFor(java.lang.Class<?> interfaces) throws java.sql.SQLException{ return getPreparedStatement().isWrapperFor(interfaces);
public boolean isWrapperFor(Class<?> interfaces) throws SQLException { return interfaces.isInstance(this);
public boolean isWrapperFor(java.lang.Class<?> interfaces) throws java.sql.SQLException{ return getPreparedStatement().isWrapperFor(interfaces); }
public java.lang.Object unwrap(java.lang.Class<?> interfaces) throws SQLException{ return getPreparedStatement().unwrap(interfaces);
public <T> T unwrap(java.lang.Class<T> interfaces) throws SQLException{ try { return interfaces.cast(this); } catch (ClassCastException cce) { throw Util.generateCsSQLException(SQLState.UNABLE_TO_UNWRAP, interfaces); }
public java.lang.Object unwrap(java.lang.Class<?> interfaces) throws SQLException{ return getPreparedStatement().unwrap(interfaces); }
updateCharacterStream(columnIndex, r, length);
updateCharacterStreamInternal(columnIndex, r, false, length, "updateAsciiStream");
public void updateAsciiStream(int columnIndex, java.io.InputStream x, long length) throws SQLException { checksBeforeUpdateXXX("updateAsciiStream", columnIndex); int colType = getColumnType(columnIndex); switch (colType) { case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case Types.CLOB: br...
updateBinaryStreamInternal(columnIndex, x, length,"updateBinaryStream");
updateBinaryStreamInternal(columnIndex, x, false, length, "updateBinaryStream");
public void updateBinaryStream(int columnIndex, java.io.InputStream x, long length) throws SQLException { checksBeforeUpdateXXX("updateBinaryStream", columnIndex); int colType = getColumnType(columnIndex); switch (colType) { case Types.BINARY: case Types.VARBINARY: case Types.LONGVARBINARY: case Types.BLO...
private void updateBinaryStreamInternal(int columnIndex, java.io.InputStream x, long length, String updateMethodName) throws SQLException { if (length < 0) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH); if (length > Integer.MAX_VALUE ) { throw newSQLException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, getCo...
private void updateBinaryStreamInternal(int columnIndex, InputStream x, final boolean lengthLess, long length, String updateMethodName) throws SQLException { if (!lengthLess) { if (length < 0) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH); if (length > Integer.MAX_VALUE ) { throw newSQLException(SQLState.L...
private void updateBinaryStreamInternal(int columnIndex, java.io.InputStream x, long length, String updateMethodName) throws SQLException { if (length < 0) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH); // max number of bytes that can be set to be inserted // ...
updateBinaryStreamInternal(columnIndex, x.getBinaryStream(), length, "updateBlob");
updateBinaryStreamInternal(columnIndex, x.getBinaryStream(), false, length, "updateBlob");
public void updateBlob(int columnIndex, Blob x) throws SQLException { checksBeforeUpdateXXX("updateBlob", columnIndex); int colType = getColumnType(columnIndex); if (colType != Types.BLOB) throw dataTypeConversion(columnIndex, "java.sql.Blob"); if (x == null) updateNul...
updateCharacterStreamInternal(columnIndex, x, length, "updateCharacterStream");
updateCharacterStreamInternal(columnIndex, x, false, length, "updateCharacterStream");
public void updateCharacterStream(int columnIndex, java.io.Reader x, long length) throws SQLException { //If the column type is the right datatype, this method will eventually call getDVDforColumnToBeUpdated which will check for //the read only resultset. But for other datatypes, we want to catch if this updateCha...
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException
private void updateCharacterStreamInternal(int columnIndex, Reader reader, final boolean lengthLess, long length, String updateMethodName) throws SQLException
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
if (length < 0) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
ReaderToUTF8Stream utfIn; int usableLength = -1; if (!lengthLess) { if (length < 0) throw newSQLException(SQLState.NEGATIVE_STREAM_LENGTH);
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
if (length > Integer.MAX_VALUE ) { throw newSQLException(SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, getColumnSQLType(columnIndex)); } int usableLength = (int) length; int truncationLength = 0;
if (length > Integer.MAX_VALUE ) { throw newSQLException( SQLState.LANG_OUTSIDE_RANGE_FOR_DATATYPE, getColumnSQLType(columnIndex)); }
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
if (getColumnType(columnIndex) == Types.CLOB) { int colWidth = resultDescription.getColumnDescriptor( columnIndex).getType().getMaximumWidth();
usableLength = (int) length; int truncationLength = 0;
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
if (usableLength > colWidth) { truncationLength = usableLength - colWidth; usableLength = colWidth;
if (getColumnType(columnIndex) == Types.CLOB) { int colWidth = resultDescription.getColumnDescriptor( columnIndex).getType().getMaximumWidth(); if (usableLength > colWidth) { truncationLength = usableLength - colWidth; usableLength = colWidth; }
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
ReaderToUTF8Stream utfIn = new ReaderToUTF8Stream( reader, usableLength, truncationLength);
private void updateCharacterStreamInternal(int columnIndex, java.io.Reader reader, long length, String updateMethodName) throws SQLException { try { if (reader == null) { updateNull(columnIndex); return; } // check for -...
columnIndex, x.getCharacterStream(),length, "updateClob");
columnIndex, x.getCharacterStream(), false, length, "updateClob");
public void updateClob(int columnIndex, Clob x) throws SQLException { checksBeforeUpdateXXX("updateClob", columnIndex); int colType = getColumnType(columnIndex); if (colType != Types.CLOB) throw dataTypeConversion(columnIndex, "java.sql.Clob"); if (x == null) { ...
catch (StringIndexOutOfBoundsException obe) { if ((pos > clobLength) && isDerbyNet) { System.out.println("EXPECTED Out of bounds exception"); } else { System.out.println("FAIL -- unexpected exception:" + obe.toString()); if (debug) obe.printStackTrace(); } }
static void printInterval(Clob clob, long pos, int length, int testNum, int iteration, int clobLength) { if (pos > clobLength) System.out.println("CLOB getSubString " + pos + " > " + clobLength); try { /* System.out.println("printInterval(" + clob + "," + pos +"," + length +",...
if ((pos > clobLength) && isDerbyNet && (e.getMessage() != null && e.getMessage().indexOf("String index out of range") >= 0)) System.out.println("EXPECTED Out of bounds exception"); else { System.out.println("FAIL -- unexpected exception:" + e.toString()); if (debug) e.printStackTrace(); }
System.out.println("FAIL -- unexpected exception:" + e.toString()); if (debug) e.printStackTrace();
static void printInterval(Clob clob, long pos, int length, int testNum, int iteration, int clobLength) { if (pos > clobLength) System.out.println("CLOB getSubString " + pos + " > " + clobLength); try { /* System.out.println("printInterval(" + clob + "," + pos +"," + length +",...
driver = (InternalDriver) DriverManager.getDriver(url);
AutoloadedDriver autoloadedDriver = (AutoloadedDriver) DriverManager.getDriver(url); driver = (InternalDriver) autoloadedDriver.getDriverModule();
InternalDriver findDriver() throws SQLException { String url = jdbcurl; if (driver == null || !driver.acceptsURL(url)) { synchronized(this) { // The driver has either never been booted, or it has been // shutdown by a 'jdbc:derby:;shutdown=true' if (driver == null || !driver.acceptsURL(url)) { n...