rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
checkIfClosed("rowDeleted"); return false;
checkIfClosed("rowUpdated"); boolean rvalue = false; try { if (isForUpdate() && getType() == java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE) { rvalue = ((ScrollInsensitiveResultSet)theResults).isDeleted(); } } catch (Throwable t) { handleException(t); } return rvalue;
public boolean rowDeleted() throws SQLException { checkIfClosed("rowDeleted"); return false; }
return false;
boolean rvalue = false; try { if (isForUpdate() && getType() == java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE) { rvalue = ((ScrollInsensitiveResultSet)theResults).isUpdated(); } } catch (Throwable t) { handleException(t); } return rvalue;
public boolean rowUpdated() throws SQLException { checkIfClosed("rowUpdated"); return false; }
rowData = null; currentRow = null;
if (getType() == TYPE_FORWARD_ONLY) { rowData = null; currentRow = null; }
public void updateRow() throws SQLException { synchronized (getConnectionSynchronization()) { checksBeforeUpdateOrDelete("updateRow", -1); // Check that the cursor is not positioned on insertRow checkNotOnInsertRow(); setupContextStack(); LanguageConnectionContex...
combiner = new ByteArrayCombinerStream(null, -34); assertEquals(0, combiner.available());
combiner = new ByteArrayCombinerStream(null, 0); assertEquals(0, combiner.available());
public void testCombineAvailableNull() throws IOException { combiner = new ByteArrayCombinerStream(null, -34); assertEquals(0, combiner.available()); }
combiner = new ByteArrayCombinerStream(null, 10);
combiner = new ByteArrayCombinerStream(null, 0);
public void testCombineNullRead() throws IOException { combiner = new ByteArrayCombinerStream(null, 10); assertEquals(-1, combiner.read()); }
combiner = new ByteArrayCombinerStream(null, 10);
combiner = new ByteArrayCombinerStream(null, 0);
public void testCombineNullReadArray() throws IOException { combiner = new ByteArrayCombinerStream(null, 10); assertEquals(-1, combiner.read(new byte[10], 0, 10)); }
jira170Test(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...
EmbeddedDataSource dscs = new EmbeddedDataSource(); dscs.setDatabaseName("wombat");
Properties attrs = new Properties(); attrs.setProperty("databaseName", "wombat"); DataSource dscs = TestUtil.getDataSource(attrs);
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...
checkConnection("EmbeddedDataSource", ds.getConnection()); EmbeddedSimpleDataSource dssimple = new EmbeddedSimpleDataSource(); dssimple.setDatabaseName("wombat");
checkConnection("DataSource", ds.getConnection()); DataSource dssimple = TestUtil.getSimpleDataSource(attrs);
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...
checkConnection("EmbeddedSimpleDataSource", ds.getConnection()); EmbeddedConnectionPoolDataSource dscsp = new EmbeddedConnectionPoolDataSource(); dscsp.setDatabaseName("wombat"); ConnectionPoolDataSource dsp = dscsp;
checkConnection("SimpleDataSource", ds.getConnection()); ConnectionPoolDataSource dsp = TestUtil.getConnectionPoolDataSource(attrs);
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...
checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection()); checkConnection("EmbeddedConnectionPoolDataSource", pc.getConnection());
checkConnection("ConnectionPoolDataSource", pc.getConnection()); checkConnection("ConnectionPoolDataSource", pc.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...
testPoolReset("EmbeddedConnectionPoolDataSource", dsp.getPooledConnection()); EmbeddedXADataSource dscsx = new EmbeddedXADataSource(); dscsx.setDatabaseName("wombat"); XADataSource dsx = dscsx;
testPoolReset("ConnectionPoolDataSource", dsp.getPooledConnection()); XADataSource dsx = TestUtil.getXADataSource(attrs);
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...
checkConnection("EmbeddedXADataSource", xac.getConnection());
checkConnection("XADataSource", xac.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...
testPoolReset("EmbeddedXADataSource", dsx.getXAConnection()); try { DriverManager.getConnection("jdbc:derby:;shutdown=true");
testPoolReset("XADataSource", dsx.getXAConnection()); try { TestUtil.getConnection("","shutdown=true");
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...
checkConnection("EmbeddedDataSource", ds.getConnection());
checkConnection("DataSource", 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...
checkConnection("EmbeddedXADataSource", xac.getConnection()); checkConnection("EmbeddedXADataSource", xac.getConnection());
checkConnection("XADataSource", xac.getConnection()); checkConnection("XADataSource", xac.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...
checkConnection("Global EmbeddedXADataSource", xac.getConnection()); checkConnection("Global EmbeddedXADataSource", xac.getConnection()); xar.end(xid, XAResource.TMSUCCESS); checkConnection("Switch to local EmbeddedXADataSource", xac.getConnection()); checkConnection("Switch to local EmbeddedXADataSource", xac.getCon...
checkConnection("Global XADataSource", xac.getConnection()); checkConnection("Global XADataSource", xac.getConnection()); xar.end(xid, XAResource.TMSUCCESS); checkConnection("Switch to local XADataSource", xac.getConnection()); checkConnection("Switch to local XADataSource", xac.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...
checkConnection("Switch to global EmbeddedXADataSource", backtoGlobal); checkConnection("Switch to global EmbeddedXADataSource", xac.getConnection());
checkConnection("Switch to global XADataSource", backtoGlobal); checkConnection("Switch to global XADataSource", xac.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...
B2IStaticCompiledInfo( TransactionController tc, B2I b2i) throws StandardException
public B2IStaticCompiledInfo()
B2IStaticCompiledInfo( TransactionController tc, B2I b2i) throws StandardException { this.b2i = b2i; this.base_table_static_info = tc.getStaticCompiledConglomInfo(b2i.baseConglomerateId); }
this.b2i = b2i; this.base_table_static_info = tc.getStaticCompiledConglomInfo(b2i.baseConglomerateId);
B2IStaticCompiledInfo( TransactionController tc, B2I b2i) throws StandardException { this.b2i = b2i; this.base_table_static_info = tc.getStaticCompiledConglomInfo(b2i.baseConglomerateId); }
String s = cd.getSchemaName();
String s = cd.getSourceSchemaName();
public String getSchemaName(int column) throws SQLException { ResultColumnDescriptor cd = columnInfo[column - 1]; String s = cd.getSchemaName(); // database returns null when no schema name to differentiate from empty name return (s==null? "" : s); }
return false;
return columnInfo[column - 1].updatableByCursor();
public boolean isWritable(int column) throws SQLException { validColumnNumber(column); // we just don't know if it is a base table column or not return false; }
bindAndExecute(pSt, 1, Types.VARCHAR, "shouldn't work", "X0X14", false);
bindAndExecute(pSt, 1, Types.VARCHAR, "shouldn't work", "42Z70", false);
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
bindAndExecute(pSt, 1, Types.VARCHAR, null, "X0X14", false);
bindAndExecute(pSt, 1, Types.VARCHAR, null, "42Z70", false);
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
bindAndExecute(pSt, 1, Types.VARCHAR, null, "X0X14", true);
bindAndExecute(pSt, 1, Types.VARCHAR, null, "42Z70", true);
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
bindAndExecute(pSt, 1, Types.INTEGER, new Integer(8), "X0X14", false);
bindAndExecute(pSt, 1, Types.INTEGER, new Integer(8), "42Z70", false);
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
checkException(se, "X0X14");
checkException(se, "42Z70");
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
checkException(se, "X0X15");
checkException(se, "42Z71");
private void doBindTests(Connection conn) { // Make sure that attempts to bind _to_ XML will fail. System.out.println("\n[ Beginning XML binding tests. ]\n"); // Binding to an XML column. PreparedStatement pSt = null; try { // If we're running in embedded mode or els...
checkException(se, "X0X19");
checkException(se, "42Z75");
private void doXMLExistsTests(Connection conn) { System.out.println("\n[ Begin XMLEXISTS tests. ]\n"); // Run some sample queries. try { existsQuery(conn, "xTable.t1", "//abb"); existsQuery(conn, "xTable.t1", "//d50"); existsQuery(conn, "xTable.t1", "//person...
this.in = in; this.bos = bos; this.startTime = System.currentTimeMillis(); if (timemin != null) { Integer i = new Integer(timemin); timeout = i.intValue(); } else timeout = 0; myThread = new Thread(this); myThread.setPriority(Thread.MIN_PRIORITY); myThread.start();
this(in, bos, timemin, null);
public ProcessStreamResult(InputStream in, BufferedOutputStream bos, String timemin) throws IOException, InterruptedException { this.in = in; this.bos = bos; this.startTime = System.currentTimeMillis(); if (timemin != null) { Integer i = new Integer(timemin); time...
byte[] ba = new byte[1024];
char[] ca = new char[1024];
public void run() { //System.out.println("Thread run... " + tname); if ( in == null ) { System.out.println("The inputstream is null"); System.exit(1); } try { byte[] ba = new byte[1024]; int valid; interrupted = false; while ((valid = in.read(ba, 0, b...
while ((valid = in.read(ba, 0, ba.length)) != -1)
InputStreamReader inStream; if(encoding != null) inStream = new InputStreamReader(in, encoding); else inStream = new InputStreamReader(in); while ((valid = inStream.read(ca, 0, ca.length)) != -1)
public void run() { //System.out.println("Thread run... " + tname); if ( in == null ) { System.out.println("The inputstream is null"); System.exit(1); } try { byte[] ba = new byte[1024]; int valid; interrupted = false; while ((valid = in.read(ba, 0, b...
*/ bos.write(ba, 0, valid); bos.flush();
*/ outStream.write(ca, 0, valid); outStream.flush();
public void run() { //System.out.println("Thread run... " + tname); if ( in == null ) { System.out.println("The inputstream is null"); System.exit(1); } try { byte[] ba = new byte[1024]; int valid; interrupted = false; while ((valid = in.read(ba, 0, b...
if (clobReader != null) clobReader.close();
if (clobReader != null){ try{ clobReader.close(); }catch(IOException e){ e.printStackTrace(); throw new SQLException(e.getMessage()); } }
public String getSubString(long pos, int length) throws SQLException { if (pos < 1) throw Util.generateCsSQLException( SQLState.BLOB_BAD_POSITION, new Long(pos)); if (length <= 0) throw Util.generateCsSQLException( SQLState.BLOB_NONPOSITIVE_LENGTH...
if (tsize == 0) truncationLWM = null; else { truncationLWM = new TruncationPoint[tsize]; UUID name; LogInstant instant; for (int i = 0; i < tsize; i++) { name = (UUID)in.readObject(); long l = CompressedNumber.readLong(in); truncationLWM[i] = new TruncationPoint(name, new LogCounter(l)); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { redoLWM = CompressedNumber.readLong(in); undoLWM = CompressedNumber.readLong(in); int tsize = CompressedNumber.readInt(in); // is there any truncationLWM? if (tsize == 0) truncationLWM = null; else { truncationLWM = new Tru...
if (truncationLWM == null) CompressedNumber.writeInt(out, 0); else { CompressedNumber.writeInt(out, truncationLWM.length); for (int i = 0; i < truncationLWM.length; i++) { out.writeObject(truncationLWM[i].getName()); LogCounter l = (LogCounter)(truncationLWM[i].getLogInstant()); CompressedNumber.writeLong(out,l.getVal...
CompressedNumber.writeInt(out, 0);
public void writeExternal(ObjectOutput out) throws IOException { CompressedNumber.writeLong(out, redoLWM); CompressedNumber.writeLong(out, undoLWM); if (truncationLWM == null) CompressedNumber.writeInt(out, 0); // no other truncation LWM else { CompressedNumber.writeInt(out, truncationLWM.length); for (int...
isXAConn);
isXAConn, this);
public NetXAConnection createControlConnection(NetLogWriter logWriter, String user, String password, org.apache.derby.jdbc.ClientDataSource dataSource, ...
testExceptionWhenClosed();
void startTestResultSetMethods(Connection conn_in,PreparedStatement ps_in,ResultSet rs_in) { conn = conn_in; ps = ps_in; rs = rs_in; t_getRowId1(); t_getRowId2(); t_updateRowId1(); t_updateRowId2(); t_getHoldability(); t_isClosed...
((Resetable)myStream).initStream();
try { ((Resetable) myStream).initStream(); } catch (StandardException se) { if (se.getMessageId().equals(SQLState.DATA_CONTAINER_CLOSED)) { throw StandardException .newException(SQLState.BLOB_ACCESSED_AFTER_COMMIT); } }
protected EmbedBlob(DataValueDescriptor dvd, EmbedConnection con) throws StandardException { super(con); // if the underlying column is null, ResultSet.getBlob will return null, // never should get this far if (SanityManager.DEBUG) SanityManager.ASSERT(!dvd.isNull(),...
else { extInDir = null; extOutDir = null; extInOutDir = null; }
private static String createPropString() throws ClassNotFoundException, FileNotFoundException, IOException { // Check for existence of app properties and/or derby.properties files // Copy the derby.properties to the db base directory // Then create the -p string for the test String p...
if (extInDir!=null) deleteFile(extInOutDir);
if (extInOutDir!=null) deleteFile(extInOutDir);
private static void doCleanup(String javaVersion) throws IOException { boolean status = true; // The output files cannot be deleted if there // is still a reference to them -- even doing // this is not a guarantee that they will be deleted // It seems to depend on the Ja...
PrintStream stdout = System.out; PrintStream stderr = System.err;
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing Properties ptmp = System.getProperties(); ptmp.put("derby.system.home", systemHome); ...
System.setOut(ps); System.setErr(ps);
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing Properties ptmp = System.getProperties(); ptmp.put("derby.system.home", systemHome); ...
System.exit(1);
System.setOut(stdout); System.setErr(stderr); System.out.println("Unit tests not implemented yet with useprocess=false");
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing Properties ptmp = System.getProperties(); ptmp.put("derby.system.home", systemHome); ...
System.out.println("JUnit tests not implemented yet with useprocess=false"); System.exit(1);
PrintStream stdout = System.out; PrintStream stderr = System.err; System.setOut(ps); System.setErr(ps); if (javaPath == null) { javaPath = "org.apache.derbyTesting.functionTests.tests." + testDirName; } String testName = javaPath + "." + testBase; Class testClass = Class.forName(testName); TestSuite ...
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing Properties ptmp = System.getProperties(); ptmp.put("derby.system.home", systemHome); ...
} System.setOut(stdout); System.setErr(stderr);
}
private static void execTestNoProcess(Properties sysProp, String systemHome, String propString, String scriptPath) throws Exception { // For platforms where executing a process is failing Properties ptmp = System.getProperties(); ptmp.put("derby.system.home", systemHome); ...
framework = sp.getProperty("framework");
String frameworkp = sp.getProperty("framework"); if (frameworkp != null) framework = frameworkp;
private static JavaVersionHolder getProperties(Properties sp) throws Exception { // Get any properties specified on the command line searchCP = sp.getProperty("ij.searchClassPath"); framework = sp.getProperty("framework"); if (framework == null) framework = "embedded"; if (!verifyFramew...
suiteName = sp.getProperty("suitename");
if (useprocess) suiteName = sp.getProperty("suitename");
private static JavaVersionHolder getProperties(Properties sp) throws Exception { // Get any properties specified on the command line searchCP = sp.getProperty("ij.searchClassPath"); framework = sp.getProperty("framework"); if (framework == null) framework = "embedded"; if (!verifyFramew...
isSuiteRun = true; topsuiteName = sp.getProperty("topsuitename");
isSuiteRun = true; if (useprocess) topsuiteName = sp.getProperty("topsuitename");
private static JavaVersionHolder getProperties(Properties sp) throws Exception { // Get any properties specified on the command line searchCP = sp.getProperty("ij.searchClassPath"); framework = sp.getProperty("framework"); if (framework == null) framework = "embedded"; if (!verifyFramew...
if (args.length == 6)
if (args.length == 7)
public static void main(String[] args) throws Exception { skiptestReason.setLength(0); // 0 out for useprocess // Determine the test type if (args.length == 0) { // No script name provided System.out.println("no test name provided"); System.exit(1); } scriptName = args[0]; if (Boolean.getBoolean("listOnl...
ns.start(); frameworkInitialized = true; }
if ((!useprocess) && (isSuiteRun)) { boolean started = false; try { started = ns.testNetworkServerConnection(); } catch (Exception e) {} if (!started && startServer) ns.start(); if (started && !startServer) ns.stop(); } else { ns.start(); serverNeedsStopping = true; } }
public static void main(String[] args) throws Exception { skiptestReason.setLength(0); // 0 out for useprocess // Determine the test type if (args.length == 0) { // No script name provided System.out.println("no test name provided"); System.exit(1); } scriptName = args[0]; if (Boolean.getBoolean("listOnl...
if (frameworkInitialized)
if (serverNeedsStopping)
public static void main(String[] args) throws Exception { skiptestReason.setLength(0); // 0 out for useprocess // Determine the test type if (args.length == 0) { // No script name provided System.out.println("no test name provided"); System.exit(1); } scriptName = args[0]; if (Boolean.getBoolean("listOnl...
if (useprocess == false) defaultPackageName = "/org/apache/derbyTesting/";
private static void setDirectories(String scriptName, Properties sp) throws ClassNotFoundException, FileNotFoundException, IOException { // Get the current userdir userdir = sp.getProperty("user.dir"); // reset defaultPackageName (for useprocess=false) //if (useprocess ...
else if ( (!useprocess) && isSuiteRun && ((usesystem==null) || (usesystem.length()<=0)) ) { String suite = (suiteName.substring(0,suiteName.indexOf(':'))); if (File.separatorChar == '\\') { String useprWin = convertPathForWin(suite); baseDir = new File(outDir, useprWin); } else { baseDir = new File(outDir, suite); } }
private static void setDirectories(String scriptName, Properties sp) throws ClassNotFoundException, FileNotFoundException, IOException { // Get the current userdir userdir = sp.getProperty("user.dir"); // reset defaultPackageName (for useprocess=false) //if (useprocess ...
Loggable lop = new CompressSpacePageOperation( (AllocPage)allocPage, new_highest_page, num_pages_truncated); allocPage.preDirty();
Loggable lop = null; if( t.getLogFactory().checkVersion(RawStoreFactory.DERBY_STORE_MAJOR_VERSION_10, RawStoreFactory.DERBY_STORE_MINOR_VERSION_3, null) ) { lop = new CompressSpacePageOperation( (AllocPage)allocPage, new_highest_page, num_pages_truncated); } else { lop = new CompressSpacePageOperation10_2( (AllocP...
public void actionCompressSpaceOperation( RawTransaction t, BasePage allocPage, int new_highest_page, int num_pages_truncated) throws StandardException { Loggable lop = new CompressSpacePageOperation( (AllocPage)allocPage, new_highest_...
clientMessageIds.add(SQLState.UNSUPPORTED_ENCODING); clientMessageIds.add(SQLState.LANG_FORMAT_EXCEPTION); clientMessageIds.add(SQLState.LANG_DATA_TYPE_GET_MISMATCH); clientMessageIds.add(SQLState.LANG_DATA_TYPE_SET_MISMATCH); clientMessageIds.add(SQLState.LANG_DATE_SYNTAX_EXCEPTION); clientMessageIds.add(SQLState.CHAR...
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...
static public void setupDataSource(Object ds) throws Exception {
static public void setupDataSource(Object ds,String dbName,boolean firstTime) throws Exception {
static public void setupDataSource(Object ds) throws Exception { // Loop over set methods on Datasource object, if there is a property // then call the method with corresponding value. java.lang.reflect.Method[] methods = ds.getClass().getMethods(); for (int i = 0; i < methods.length; i++) { java.lang.reflect.M...
String property = name.substring("set".length()); property = "ij.dataSource."+property.substring(0,1).toLowerCase(java.util.Locale.ENGLISH)+ property.substring(1); String value = util.getSystemProperty(property); if (value != null) { try { m.invoke(ds, new Object[] {value}); } catch (Throwable ignore) { m.invoke(ds,...
if(name.equals("setCreateDatabase") && !firstTime) continue; String property = name.substring("set".length()); property = "ij.dataSource."+property.substring(0,1).toLowerCase(java.util.Locale.ENGLISH)+ property.substring(1); String value = util.getSystemProperty(property); if(name.equals("setDatabaseName") && !firstTi...
static public void setupDataSource(Object ds) throws Exception { // Loop over set methods on Datasource object, if there is a property // then call the method with corresponding value. java.lang.reflect.Method[] methods = ds.getClass().getMethods(); for (int i = 0; i < methods.length; i++) { java.lang.reflect.M...
"more unfilled pages than allocated pages on extent ");
"more unfilled pages than allocated pages on extent[" + i + "], " + "numUnfilledPages = " + numUnfilledPages + ", numAllocatedPages = " + numAllocatedPages + ", numFreePages = " + numFreePages); }
protected SpaceInformation getAllPageCounts( BaseContainerHandle handle, long firstAllocPageNumber) throws StandardException { long currAllocPages = 0; long numAllocatedPages = 0; long numFreePages = 0; long numUnfilledPages = 0; if (!isValid) validate(handle, fi...
private void runTest() throws SQLException, Exception {
private void runTest() throws Exception {
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
OnlineBackup backup = new OnlineBackup(TEST_DATABASE_NAME); Thread backupThread = new Thread(backup, "BACKUP"); backupThread.start(); backup.waitForBackupToBegin(); logMessage("BACKUP STARTED");
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
dmlThread.start();
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
ddlThread.start();
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
java.lang.Thread.sleep(50000);
try { backupThread.start(); backup.waitForBackupToBegin(); logMessage("BACKUP STARTED"); dmlThread.start(); ddlThread.start(); java.lang.Thread.sleep(50000);
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
backup.waitForBackupToEnd(); backupThread.join(); dmlActions.stopActivity(); ddlActions.stopActivity(); dmlThread.join(); ddlThread.join();
backup.waitForBackupToEnd(); }finally { backupThread.join(); dmlActions.stopActivity(); ddlActions.stopActivity(); dmlThread.join(); ddlThread.join(); }
private void runTest() throws SQLException, Exception { logMessage("Begin Online Backup Test1"); Connection conn = ij.startJBMS(); conn.setAutoCommit(false); DatabaseActions dbActions = new DatabaseActions(conn); //create the test tables. dbActions.createTable(TEST_TABLE_NAME); dbActions.createTable(TES...
throw new java.lang.IllegalArgumentException("Decimal may only be up to 31 digits!");
throw new java.lang.IllegalArgumentException( msgutil.getTextMessage(SQLState.DECIMAL_TOO_MANY_DIGITS));
public static final java.math.BigDecimal getBigDecimal(byte[] buffer, int offset, int precision, int scale) throws java.io.UnsupportedEncoding...
throw new java.lang.IllegalArgumentException("Decimal may only be up to 31 digits!");
throw new java.lang.IllegalArgumentException( msgutil.getTextMessage(SQLState.DECIMAL_TOO_MANY_DIGITS));
public static final double getDouble(byte[] buffer, int offset, int precision, int scale) throws java.io.UnsupportedEncodingException { // The byte-length of a packed decimal with precision...
throw new java.lang.IllegalArgumentException("Decimal may only be up to 31 digits!");
throw new java.lang.IllegalArgumentException( msgutil.getTextMessage(SQLState.DECIMAL_TOO_MANY_DIGITS));
public static final long getLong(byte[] buffer, int offset, int precision, int scale) throws java.io.UnsupportedEncodingException { if (precision > 31) { // throw an exception here if nibble...
throw new java.lang.IllegalArgumentException("Unsupported date format!");
throw new java.lang.IllegalArgumentException( MessageUtil.getCompleteMessage(SQLState.LANG_FORMAT_EXCEPTION, SqlException.CLIENT_MESSAGE_RESOURCE_NAME, (Object[])null));
public static final java.sql.Date dateBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) throws UnsupportedEncodingEx...
java.sql.Date date) throws ConversionException {
java.sql.Date date) throws SqlException {
public static final int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws ConversionException { int year = date.getYear() + 1900; if (year > 9999) { throw new ConversionException("Year ...
throw new ConversionException("Year exceeds the maximum \"9999\".");
throw new SqlException(null, new MessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), new Integer(year), "9999");
public static final int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws ConversionException { int year = date.getYear() + 1900; if (year > 9999) { throw new ConversionException("Year ...
java.sql.Date date) throws ConversionException {
java.sql.Date date) throws SqlException {
public static final int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws ConversionException { int year = date.getYear() + 1900; if (year > 9999) { throw new ConversionE...
throw new ConversionException("Year exceeds the maximum \"9999\".");
throw new SqlException(null, new MessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), new Integer(year), "9999");
public static final int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws ConversionException { int year = date.getYear() + 1900; if (year > 9999) { throw new ConversionE...
java.sql.Timestamp timestamp) throws ConversionException {
java.sql.Timestamp timestamp) throws SqlException {
public static final int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws ConversionException { int year = timestamp.getYear() + 1900; if (year > 9999) { throw ...
throw new ConversionException("Year exceeds the maximum \"9999\".");
throw new SqlException(null, new MessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), new Integer(year), "9999");
public static final int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws ConversionException { int year = timestamp.getYear() + 1900; if (year > 9999) { throw ...
java.sql.Timestamp timestamp) throws ConversionException {
java.sql.Timestamp timestamp) throws SqlException {
public static final int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws ConversionException { int year = timestamp.getYear() + 1900; if (year > 9999) { ...
throw new ConversionException("Year exceeds the maximum \"9999\".");
throw new SqlException(null, new MessageId(SQLState.YEAR_EXCEEDS_MAXIMUM), new Integer(year), "9999");
public static final int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws ConversionException { int year = timestamp.getYear() + 1900; if (year > 9999) { ...
RoutinePermsDescriptor routinePermDesc = new RoutinePermsDescriptor( this, "PUBLIC", authorizationDBA, routineUUID); addDescriptor( routinePermDesc, null, DataDictionary.SYSROUTINEPERMS_CATALOG_NUM, false, tc);
createRoutinePermPublicDescriptor(routineUUID, tc, authorizationDBA);
void createRoutinePermPublicDescriptor( UUID routineUUID, TransactionController tc) throws StandardException { RoutinePermsDescriptor routinePermDesc = new RoutinePermsDescriptor( this, "PUBLIC", authorizationDBA, routineUUID); addDescriptor( routinePermDesc, null, DataDictionary.SYSROUTINEPERMS_C...
derby500Test(conn); derby500_verifyVarcharStreams(conn);
public static void main(String[] args) { System.out.println("Test streamingColumn starting"); try { // use the ij utility to read the property file and // make the initial connection. ij.getPropertyArg(args); Connection conn = ij.startJBMS(); streamTest1(conn); // test column size 1500 bytes streamTest...
return(getPageForInsert(handle, flag));
BasePage p = null; boolean getLastInserted = (flag & ContainerHandle.GET_PAGE_UNFILLED) == 0; if (getLastInserted) { long localLastInsertedPage = getLastInsertedPage(); if ((localLastInsertedPage < pageno) && (localLastInsertedPage != ContainerHandle.INVALID_PAGE_NUMBER)) { p = getInsertablePage( handle, localLas...
protected BasePage getPageForCompress( BaseContainerHandle handle, int flag, long pageno) throws StandardException { return(getPageForInsert(handle, flag)); }
catch (StandardException se) {
finally {
protected void compressContainer( RawTransaction ntt, BaseContainerHandle allocHandle) throws StandardException { AllocPage alloc_page = null; AllocPage prev_alloc_page = null; if (firstAllocPageNumber == ContainerHandle.INVALID_PAGE_NUMBER) { // no allocation pages in container...
System.out.println("calling flushAll()"); flushAll(); System.out.println("calling discard."); pageCache.discard(identity);
protected void compressContainer( RawTransaction ntt, BaseContainerHandle allocHandle) throws StandardException { AllocPage alloc_page = null; AllocPage prev_alloc_page = null; if (firstAllocPageNumber == ContainerHandle.INVALID_PAGE_NUMBER) { // no allocation pages in container...
Connection conn = NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL + dbName + attrString, p); conn.setAutoCommit(false);
Connection conn = NetworkServerControlImpl.getDriver().connect(Attribute.PROTOCOL + shortDbName + attrString, p); if(conn != null){ conn.setAutoCommit(false); }
protected Connection makeConnection(Properties p) throws SQLException { p.put(Attribute.USERNAME_ATTR, userId); // take care of case of SECMEC_USRIDONL if(password != null) p.put(Attribute.PASSWORD_ATTR, password); Connection conn = NetworkServerControlImpl.getDriv...
defaultStatement.setStatement(conn);
if(conn != null) defaultStatement.setStatement(conn);
protected void setConnection(Connection conn) throws SQLException { this.conn = conn; defaultStatement.setStatement(conn); }
ps.setQueryTimeout(0L);
static boolean validateConstraint ( String constraintName, String constraintText, TableDescriptor td, LanguageConnectionContext lcc, boolean isCheckConstraint ) throws StandardException { StringBuffer checkStmt = new StringBuffer(); /* should not use select sum(not(<check-predicate>) ? ...
if (curpos == LogToFile.LOG_FILE_HEADER_SIZE) continue;
private LogRecord getNextRecordBackward(ArrayInputStream input, TransactionId tranId, int groupmask) throws StandardException, IOException, ClassNotFoundException { if (SanityManager.DEBUG) SanityManager.ASSERT(scanDirection == BACKWARD, "can only called by backward scan"); // scan is pos...
try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "setUnicodeStream", parameterIndex, "<input stream>", length); } parameterIndex = checkSetterPreconditions(parameterIndex); parameterMetaData_.clientParamtertype_[parameterIndex - 1] = java.sql.Types.CLOB; if ...
if (agent_.loggingEnabled()) { agent_.logWriter_.traceDeprecatedEntry(this, "setUnicodeStream", parameterIndex, "<input stream>", length);
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.tra...
catch ( SqlException se ) { throw se.getSQLException(); }
throw SQLExceptionFactory.notImplemented ("setUnicodeStream");
public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.tra...
if (isXAConnection_) { if (indoubtTransactions_ != null) { indoubtTransactions_.clear(); } indoubtTransactions_ = indoubtTransactions; }
public void setIndoubtTransactions(java.util.Hashtable indoubtTransactions) { }
try { checkEmptyRS(met.getFunctionParameters(null,null,null,null)); } catch (SQLException e) { System.out.println("getFunctionParameters():"); dumpSQLExceptions(e); } catch (AbstractMethodError ame) { System.out.println("getFunctionParameters():"); ame.printStackTrace(System.out); }
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); if (!met.supportsStoredFunctionsUsingCallSyntax()) { Sys...
dumpRS(met.getFunctionParameters(null,null,"DUMMY%",null)); dumpRS(met.getFunctionParameters(null,null,"DUMMY%",""));
private static void testDatabaseMetaDataMethods(Connection con) throws Exception { con.setAutoCommit(true); // make sure it is true Statement s = con.createStatement(); DatabaseMetaData met = con.getMetaData(); if (!met.supportsStoredFunctionsUsingCallSyntax()) { Sys...
TestSuite testSuite = new TestSuite("TestDbMetaData suite"); testSuite.addTestSuite(TestDbMetaData.class); return new CleanDatabaseTestSetup(testSuite) { protected void decorateSQL(Statement s) throws SQLException { createFunctions(s); } };
TestSuite suite = new TestSuite("TestDbMetaData suite"); suite.addTest(baseSuite("TestDbMetaData:embedded")); suite.addTest(TestConfiguration.clientServerDecorator( baseSuite("TestDbMetaData:client"))); return suite;
public static Test suite() { TestSuite testSuite = new TestSuite("TestDbMetaData suite"); testSuite.addTestSuite(TestDbMetaData.class); return new CleanDatabaseTestSetup(testSuite) { protected void decorateSQL(Statement s) throws SQLException { createFunctions(...
int val = reader.readByte();
byte val = reader.readByte();
private boolean readBoolean(int codepoint) throws DRDAProtocolException { checkLength(codepoint, 1); int val = reader.readByte(); if (val == CodePoint.TRUE) return true; else if (val == CodePoint.FALSE) return false; else invalidValue(codepoint); return false; //to shut the compiler up }
for (Enumeration e = new ProviderEnumeration( applicationProperties); ; ) {
Enumeration e = new ProviderEnumeration( applicationProperties); while (e.hasMoreElements()) {
protected void bootPersistentServices() { for (Enumeration e = new ProviderEnumeration( applicationProperties); ; ) { PersistentService provider = (PersistentService) e.nextElement(); bootProviderServices(provider); } }
throw StandardException.newException( SQLState.FILE_CREATE_NO_CLEANUP, ioe, file, se);
throw StandardException.newException( SQLState.FILE_CREATE_NO_CLEANUP, ioe, file, se.toString());
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...
throw StandardException.newException( SQLState.FILE_CREATE_NO_CLEANUP, ioe, file, null);
throw StandardException.newException( SQLState.FILE_CREATE_NO_CLEANUP, ioe, file, ioe.toString());
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...
throw dataFactory.markCorrupt( StandardException.newException( SQLState.FILE_CONTAINER_EXCEPTION, ioe, this, ioe));
throw dataFactory. markCorrupt(StandardException. newException(SQLState. FILE_CONTAINER_EXCEPTION, ioe, this));
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...
throw dataFactory.markCorrupt( StandardException.newException( SQLState.FILE_CONTAINER_EXCEPTION, ioe2, this, ioe2));
throw dataFactory. markCorrupt(StandardException. newException(SQLState. FILE_CONTAINER_EXCEPTION, ioe2, this));
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...
throw StandardException.newException( SQLState.FILE_CANNOT_REMOVE_FILE, se, file, se);
throw StandardException. newException(SQLState.FILE_CANNOT_REMOVE_FILE, se, file, se.toString());
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...
SQLState.FILE_CANNOT_REMOVE_FILE, ioe2, file, ioe);
SQLState.FILE_CANNOT_REMOVE_FILE, ioe2, file, ioe.toString());
public Object run() throws StandardException { switch( actionCode) { case GET_FILE_NAME_ACTION: return privGetFileName( actionIdentity, actionStub, actionErrorOK, actionTryAlternatePath); case CREATE_CONTAINER_ACTION: { StorageFile file = privGetF...