rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
containsTopLevelAttr = false;
public XML() { xmlStringValue = null; xType = -1; }
public UserDefinedTypeIdImpl(String className) { super(className); this.className = className; JDBCTypeId = java.sql.Types.JAVA_OBJECT; }
public UserDefinedTypeIdImpl() { super(); }
public UserDefinedTypeIdImpl(String className) { super(className); this.className = className; JDBCTypeId = java.sql.Types.JAVA_OBJECT; }
softwareVersion = new DD_Version(this, DataDictionary.DD_VERSION_DERBY_10_2);
softwareVersion = new DD_Version(this, DataDictionary.DD_VERSION_DERBY_10_3);
public void boot(boolean create, Properties startParams) throws StandardException { softwareVersion = new DD_Version(this, DataDictionary.DD_VERSION_DERBY_10_2); /* There is a bootstrapping problem here. We would like to use * a language connection context to find the name of the system and default ...
public static final String getTypeDesc(int ty)
public String getTypeDesc()
public static final String getTypeDesc(int ty) { if (ty>0 && ty<JobEntryInterface.typeCode.length) return JobEntryInterface.typeCode[ty]; return JobEntryInterface.typeCode[0]; }
if (ty>0 && ty<JobEntryInterface.typeCode.length) return JobEntryInterface.typeCode[ty]; return JobEntryInterface.typeCode[0];
if (getTypeDesc(entry.getType()).equals(JobEntryInterface.typeCode[0])) return entry.getTypeCode(); return getTypeDesc( entry.getType() );
public static final String getTypeDesc(int ty) { if (ty>0 && ty<JobEntryInterface.typeCode.length) return JobEntryInterface.typeCode[ty]; return JobEntryInterface.typeCode[0]; }
prout = new ProcessStreamResult(pr.getInputStream(), _bos, null); prerr = new ProcessStreamResult(pr.getErrorStream(), _bos, null);
prout = new ProcessStreamResult(pr.getInputStream(), _bos, timeoutMinutes); prerr = new ProcessStreamResult(pr.getErrorStream(), _bos, timeoutMinutes);
private static void execCmdDumpResults (String[] args, boolean wait) throws Exception { // We need the process inputstream and errorstream ProcessStreamResult prout = null; ProcessStreamResult prerr = null; System.out.flush(); bos.flush(); BufferedOutputStr...
testDbNameWithSpaces(driver);
public static void main(String[] args) { try { Driver driver = loadAndCheckDriverForFramework(); checkAcceptsURL(driver); testEmbeddedAttributes(driver); testClientAttributes(driver); doClientURLTest(driver); } catch (SQLException se) { while (se != null) { se.printStackTrace(System.out); ...
if (usingEmbedded()) { assertEquals("Unexpected exception thrown: " + sqle.getMessage(), SQLState.LANG_INVALID_TRANSACTION_STATE, sqle.getSQLState()); } else { assertEquals("Unexpected exception thrown: " + sqle.getMessage(), "java.sql.Connection.close() requested while a " + "transaction is in progress on the connect...
String expectedState; if ( this.usingDerbyNetClient() ) expectedState = SQLStateConstants.INVALID_TRANSACTION_STATE_ACTIVE_SQL_TRANSACTION; else expectedState = SQLStateConstants.INVALID_TRANSACTION_STATE_NO_SUBCLASS; if ( ! expectedState.equals(sqle.getSQLState()) ) { System.err.println("ERROR: Unexpected SQL State e...
public void testIsClosedWhenClosingConnectionInInvalidState() throws SQLException { stmt.executeQuery("select count(*) from stmtTable"); // Connection should now be in an invalid transaction state. try { con.close(); fail("Invalid transaction state exception was not...
public static void getUsedVariables(String aString, List list)
private static void getUsedVariables(String aString, String open, String close, List list, boolean includeSystemVariables)
public static void getUsedVariables(String aString, List list) { getUsedVariables(aString, UNIX_OPEN, UNIX_CLOSE, list); getUsedVariables(aString, WINDOWS_OPEN, WINDOWS_CLOSE, list); }
getUsedVariables(aString, UNIX_OPEN, UNIX_CLOSE, list); getUsedVariables(aString, WINDOWS_OPEN, WINDOWS_CLOSE, list);
if (aString==null) return; int p=0; while (p<aString.length()) { if (aString.substring(p).startsWith(open)) { int from = p+open.length(); int to = aString.indexOf(close, from+1); if ( to >= 0 ) { String variable = aString.substring(from, to); if (Const.indexOfString(variable, list)<0) { if (includeSystemVariables...
public static void getUsedVariables(String aString, List list) { getUsedVariables(aString, UNIX_OPEN, UNIX_CLOSE, list); getUsedVariables(aString, WINDOWS_OPEN, WINDOWS_CLOSE, list); }
if (defaultNode == null) defaultInfo = (DefaultInfoImpl)cd.getDefaultInfo(); if (autoinc_create_or_modify_Start_Increment == ColumnDefinitionNode.MODIFY_AUTOINCREMENT_RESTART_VALUE) autoincrementIncrement = cd.getAutoincInc(); if (autoinc_create_or_modify_Start_Increment == ColumnDefinitionNode.MODIFY_AUTOINCREMENT_INC...
void bindAndValidateDefault(DataDictionary dd, TableDescriptor td) throws StandardException { ColumnDescriptor cd; // First verify that the column exists cd = td.getColumnDescriptor(name); if (cd == null) { throw StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, name, td.getName()); } ...
getCompilerContext().addRequiredColumnPriv( columnDescriptor);
if (isPrivilegeCollectionRequired()) getCompilerContext().addRequiredColumnPriv( columnDescriptor);
public void bindResultColumnByName(TableDescriptor tableDescriptor, int columnId) throws StandardException { ColumnDescriptor columnDescriptor; columnDescriptor = tableDescriptor.getColumnDescriptor(exposedName); if (columnDescriptor == null) { String errorString; String schemaName; errorString = ""...
return DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost",
String dbName = "wombat"; if (dbNotCreated) { dbName = dbName + ";create=true"; dbNotCreated = false; } return DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost",
private static Connection getConnection() throws SQLException { return DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost", 1527) + "wombat;create=true", "testuser", "testpassword"); }
"wombat;create=true",
dbName,
private static Connection getConnection() throws SQLException { return DriverManager.getConnection(TestUtil.getJdbcUrlPrefix("localhost", 1527) + "wombat;create=true", "testuser", "testpassword"); }
PrintStream printOut = new PrintStream(rawBytes);
public void runTest() throws Throwable { String resource = "org/apache/derbyTesting/functionTests/tests/" + getArea() + "/" + getName() + ".sql"; String canon = "org/apache/derbyTesting/functionTests/master/" + getName() + ".out"; URL sql = getTestResource(resource); assertNotNull("SQL script missing: ...
printOut,
rawBytes,
public void runTest() throws Throwable { String resource = "org/apache/derbyTesting/functionTests/tests/" + getArea() + "/" + getName() + ".sql"; String canon = "org/apache/derbyTesting/functionTests/master/" + getName() + ".out"; URL sql = getTestResource(resource); assertNotNull("SQL script missing: ...
printOut.flush(); printOut.close();
rawBytes.flush(); rawBytes.close();
public void runTest() throws Throwable { String resource = "org/apache/derbyTesting/functionTests/tests/" + getArea() + "/" + getName() + ".sql"; String canon = "org/apache/derbyTesting/functionTests/master/" + getName() + ".out"; URL sql = getTestResource(resource); assertNotNull("SQL script missing: ...
if ((xaState_ == XA_T0_NOT_ASSOCIATED) ) { readLocalXACommit_(); }
readXACommit_ ();
public void readCommit() throws SqlException { if (isXAConnection_) { if ((xaState_ == XA_T0_NOT_ASSOCIATED) ) { readLocalXACommit_(); } } else { readLocalCommit_(); } }
if ((xaState_ == XA_T0_NOT_ASSOCIATED) ) { writeLocalXACommit_(); }
writeXACommit_ ();
public void writeCommit() throws SqlException { if (isXAConnection_) { if ((xaState_ == XA_T0_NOT_ASSOCIATED) ) { writeLocalXACommit_(); } } else { writeLocalCommit_(); } }
writeLocalXARollback_();
writeXARollback_ ();
public void writeRollback() throws SqlException { if (isXAConnection_) { writeLocalXARollback_(); } else { writeLocalRollback_(); } }
if (isXAConnection_) { writeXATransactionStart (statement); }
public void writeTransactionStart(Statement statement) throws SqlException { }
client = new TestSuite("ConnectionTest:client XADataSource"); client.addTestSuite(ConnectionTest.class); client.addTest(clientSuite("ConnectionTest:client-only XADataSource")); connSuite.addTest( TestConfiguration.clientServerDecorator( TestConfiguration.connectionXADecorator(client)));
public static Test suite() { TestSuite connSuite = new TestSuite("ConnectionTest suite"); TestSuite embedded = new TestSuite("ConnectionTest:embedded"); embedded.addTestSuite(ConnectionTest.class); embedded.addTest(embeddedSuite("ConnectionTest:embedded-only")); connSuite.addTest(...
if (hasJava5FairLocks) { try { fairLock = fairLockConstructor.newInstance( new Object[] { Boolean.TRUE }); } catch (Exception e) { hasJava5FairLocks = false; if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "failed constructing ReentrantLock", e); } } }
RAFContainer(BaseDataFileFactory factory) { super(factory); // If Java 1.5 fair locks are available, construct one. if (hasJava5FairLocks) { try { // construct a lock with fairness set to true fairLock = fairLockConstructor.newInstance( new Object[] { Boolean.TRUE ...
if (hasJava5FairLocks) { try { lock.invoke(fairLock, null); } catch (Exception e) { hasJava5FairLocks = false; if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "failed invoking ReentrantLock.lock()", e); } } }
synchronized (this) {
protected void readPage(long pageNumber, byte[] pageData) throws IOException, StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(!getCommittedDropState()); } long pageOffset = pageNumber * pageSize; // Use Java 1.5 fair locks if they are available. if (hasJava5FairLocks) { try { lock.inv...
try { synchronized (this) { fileData.seek(pageOffset); fileData.readFully(pageData, 0, pageSize); } } finally { if (hasJava5FairLocks) { try { unlock.invoke(fairLock, null); } catch (Exception e) { hasJava5FairLocks = false; if (SanityManager.DEBUG) { SanityManager.THROWASSERT( "failed invoking ReentrantLock...
fileData.seek(pageOffset); fileData.readFully(pageData, 0, pageSize);
protected void readPage(long pageNumber, byte[] pageData) throws IOException, StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT(!getCommittedDropState()); } long pageOffset = pageNumber * pageSize; // Use Java 1.5 fair locks if they are available. if (hasJava5FairLocks) { try { lock.inv...
Connection applicationConnection = currentConnectionHandle = realConnection.getLocalDriver().newBrokeredConnection(this);
Connection applicationConnection = currentConnectionHandle = ((org.apache.derby.jdbc.Driver20) (realConnection.getLocalDriver())).newBrokeredConnection(this);
protected final Connection getNewCurrentConnectionHandle() { Connection applicationConnection = currentConnectionHandle = realConnection.getLocalDriver().newBrokeredConnection(this); realConnection.setApplicationConnection(applicationConnection); return applicationConnection; }
public FetchDescriptor( int input_row_length, FormatableBitSet input_validColumns, Qualifier[][] input_qualifier_list)
FetchDescriptor()
public FetchDescriptor( int input_row_length, FormatableBitSet input_validColumns, Qualifier[][] input_qualifier_list) { row_length = input_row_length; qualifier_list = input_qualifier_list; if (qualifier_list != null) { materialized_col...
row_length = input_row_length; qualifier_list = input_qualifier_list; if (qualifier_list != null) { materialized_cols = new int[row_length]; } setValidColumns(input_validColumns);
public FetchDescriptor( int input_row_length, FormatableBitSet input_validColumns, Qualifier[][] input_qualifier_list) { row_length = input_row_length; qualifier_list = input_qualifier_list; if (qualifier_list != null) { materialized_col...
return getBytes().length;
return (getBytes() == null) ? 0 : getBytes().length;
public final int getLength() throws StandardException { if (stream != null) { if (streamLength != -1) return streamLength; } return getBytes().length; }
connection_ = null;
public final void tearDown() throws SQLException { connection_.rollback(); connection_.close(); }
public void tearDown() throws SQLException {
public void tearDown() throws Exception {
public void tearDown() throws SQLException { stmt_.close(); }
stmt_ = null; super.tearDown();
public void tearDown() throws SQLException { stmt_.close(); }
public static Test suite() { TestSuite topSuite = new TestSuite("ClosedObjectTest suite"); TestSuite dsSuite = new TestSuite("ClosedObjectTest DataSource"); DataSourceDecorator dsDecorator = new DataSourceDecorator(dsSuite); topSuite.addTest(dsDecorator); fillDataSourceSuite(dsSuite, dsDecorator); TestSuite poolSuit...
public static Test suite() { TestSuite suite = new TestSuite("ClosedObjectTest suite"); suite.addTest(baseSuite("ClosedObjectTest:embedded")); return suite;
public static Test suite() { TestSuite topSuite = new TestSuite("ClosedObjectTest suite"); TestSuite dsSuite = new TestSuite("ClosedObjectTest DataSource"); DataSourceDecorator dsDecorator = new DataSourceDecorator(dsSuite); topSuite.addTest(dsDecorator); fillDataSourceSuite(dsSu...
public static void copyRefColumns(ExecRow to, ExecRow from, int start, int count) throws StandardException
public static void copyRefColumns(ExecRow to, ExecRow from)
public static void copyRefColumns(ExecRow to, ExecRow from, int start, int count) throws StandardException { copyRefColumns(to, 0, from, start, count); }
copyRefColumns(to, 0, from, start, count);
Object[] src = from.getRowArray(); Object[] dst = to.getRowArray(); System.arraycopy(src, 0, dst, 0, src.length);
public static void copyRefColumns(ExecRow to, ExecRow from, int start, int count) throws StandardException { copyRefColumns(to, 0, from, start, count); }
public static String toString(ExecRow row, int startPoint, int endPoint)
public static String toString(ExecRow row)
public static String toString(ExecRow row, int startPoint, int endPoint) { return toString(row.getRowArray(), startPoint, endPoint); }
return toString(row.getRowArray(), startPoint, endPoint);
if (SanityManager.DEBUG) { return (row == null) ? "null" : toString(row.getRowArray()); } else { return ""; }
public static String toString(ExecRow row, int startPoint, int endPoint) { return toString(row.getRowArray(), startPoint, endPoint); }
java.util.StringTokenizer stForType = new java.util.StringTokenizer(st.nextToken(), ","); if ((new Integer(stForType.nextToken())).intValue() == concurrency) { while (st.hasMoreTokens()) { if ((new Integer(st.nextToken())).intValue() == type) {
java.util.StringTokenizer stForConc = new java.util.StringTokenizer(st.nextToken(), ","); if ((new Integer(stForConc.nextToken())).intValue() == type) { while (stForConc.hasMoreTokens()) { if ((new Integer(stForConc.nextToken())).intValue() == concurrency) {
private boolean getMetaDataInfoInt_SupportsResultSetConcurrency(int infoCallIndex, int type, int concurrency) throws SQLException { // The stored procured will return a String containg a list of concurrency and list of resultSet types which support // a perticular concurrency // For eg. if the ...
if (xaState_ == XA_LOCAL) {
if (xaState_ == XA_T0_NOT_ASSOCIATED) {
protected boolean allowLocalCommitRollback_() throws org.apache.derby.client.am.SqlException { if (xaState_ == XA_LOCAL) { return true; } return false; }
if (xaState == XA_LOCAL) {
if (xaState == XA_T0_NOT_ASSOCIATED) {
public boolean willAutoCommitGenerateFlow() { // this logic must be in sync with writeCommit() logic if (!autoCommit_) { return false; } if (!isXAConnection_) { return true; } boolean doCommit = false; int xaState = getXAState(); ...
protected Connection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, java.util.Properties properties) throws SqlException { if (logWriter != null) { logWriter.traceConnectEntry(serverName, portNumber, databaseName, properties); } org.apache.derby.client.am.Con...
protected Connection(org.apache.derby.client.am.LogWriter logWriter, String user, String password, org.apache.derby.jdbc.ClientBaseDataSource dataSource) throws SqlException { initConnection(logWriter, user, dataSource);
protected Connection(LogWriter logWriter, int driverManagerLoginTimeout, String serverName, int portNumber, String databaseName, java.util.Properties properties) throws SqlException { if (l...
NetAgent(NetConnection netConnection, org.apache.derby.client.am.LogWriter netLogWriter, int loginTimeout, String server, int port) throws SqlException { super(netConnection, netLogWriter); server_ = server; port_ = port; netConnection_ = netConnection; if (server_ == null) { throw new DisconnectException(this, new Cl...
public NetAgent(NetConnection netConnection, org.apache.derby.client.am.LogWriter logWriter) throws SqlException { super(netConnection, logWriter); this.netConnection_ = netConnection;
NetAgent(NetConnection netConnection, org.apache.derby.client.am.LogWriter netLogWriter, int loginTimeout, String server, int port) throws SqlException { super(netConnection, netLogWriter); server_ = server; port_ = port; netConnection_ = n...
NetCallableStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability) throws SqlException { this(ClientDriver.getFactory().newCallableStatement(netAgent, netConnection, sql, type, concurrency, holdability), netAgent, netConnection);
NetCallableStatement(CallableStatement statement, NetAgent netAgent, NetConnection netConnection) throws SqlException { super(statement, netAgent, netConnection); initNetCallableStatement(); initNetCallableStatement(statement);
NetCallableStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability) throws SqlException { this(ClientDriver.getFactory().newCallable...
NetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, Section section) throws SqlException { this(ClientDriver.getFactory().newPreparedStatement(netAgent, netConnection, sql, section), netAgent, netConnection);
NetPreparedStatement(org.apache.derby.client.am.PreparedStatement statement, NetAgent netAgent, NetConnection netConnection) { super(statement, netAgent, netConnection); initNetPreparedStatement(statement);
NetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, Section section) throws SqlException { this(ClientDriver.getFactory().newPreparedStatement(netAgent, netConnection, sql, section), ...
void resetNetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames) throws SqlException { preparedStatement_.resetPreparedStatement(netAgent, netConnection, sql, type, concurrency, holdability, autoGeneratedK...
void resetNetPreparedStatement(org.apache.derby.client.am.PreparedStatement statement, NetAgent netAgent, NetConnection netConnection) { super.resetNetStatement(statement, netAgent, netConnection); initNetPreparedStatement(statement);
void resetNetPreparedStatement(NetAgent netAgent, NetConnection netConnection, String sql, int type, int concurrency, int holdability, int autoGeneratedKeys, String[] columnNames) throws SqlException { preparedStatement_.resetPreparedStatement(netAgent, netConnection, sql, type, concurrency, holdability, aut...
public final void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException { getPreparedStatement().setAsciiStream(parameterIndex,x,length);
public final void setAsciiStream(int parameterIndex, InputStream x) throws SQLException { getPreparedStatement().setAsciiStream(parameterIndex, x);
public final void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException { getPreparedStatement().setAsciiStream(parameterIndex,x,length); }
public final void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException { getPreparedStatement().setBinaryStream(parameterIndex,x,length);
public final void setBinaryStream(int parameterIndex, InputStream x) throws SQLException { getPreparedStatement().setBinaryStream(parameterIndex, x);
public final void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException { getPreparedStatement().setBinaryStream(parameterIndex,x,length); }
public final void setCharacterStream(int parameterIndex, Reader x, long length) throws SQLException { getPreparedStatement().setCharacterStream(parameterIndex,x,length);
public final void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { getPreparedStatement().setCharacterStream(parameterIndex, reader);
public final void setCharacterStream(int parameterIndex, Reader x, long length) throws SQLException { getPreparedStatement().setCharacterStream(parameterIndex,x,length); }
public void setNCharacterStream(int index, Reader value, long length) throws SQLException{ getPreparedStatement().setNCharacterStream (index, value, length);
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { getPreparedStatement().setNCharacterStream(parameterIndex, value);
public void setNCharacterStream(int index, Reader value, long length) throws SQLException{ getPreparedStatement().setNCharacterStream (index, value, length); }
statement = ps;
public void doTag(XMLOutput output) throws Exception { if (!maxRowsSpecified) { Object obj = context.getVariable("org.apache.commons.jelly.sql.maxRows"); if (obj != null) { if (obj instanceof Integer) { maxRows = ((Integer) obj).intValue(); ...
" low = " + low + ", recordCount = " + recordCount);
" low = " + low + ", recordCount = " + recordCount + "\n page = " + this);
protected StoredRecordHeader shiftUp(int low) { if (SanityManager.DEBUG) { SanityManager.ASSERT(isLatched()); if ((low < 0) || (low > recordCount)) { SanityManager.THROWASSERT( "shiftUp failed, low must be between 0 and recordCount." + " low = " + ...
return new EmbedResultSetMetaData(resultDesc.getColumnInfo());
return factory.newEmbedResultSetMetaData(resultDesc.getColumnInfo());
protected EmbedResultSetMetaData newEmbedResultSetMetaData(ResultDescription resultDesc) { return new EmbedResultSetMetaData(resultDesc.getColumnInfo()); }
positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWDELETED].getBoolean();
if (currentPosition <= positionInSource && currentPosition > 0) { positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWDELETED].getBoolean(); } return false;
public boolean isDeleted() throws StandardException { positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWDELETED].getBoolean(); }
positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWUPDATED].getBoolean();
if (currentPosition <= positionInSource && currentPosition > 0) { positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWUPDATED].getBoolean(); } return false;
public boolean isUpdated() throws StandardException { positionInHashTable.setValue(currentPosition); DataValueDescriptor[] hashRowArray = (DataValueDescriptor[]) ht.get(positionInHashTable); return hashRowArray[POS_ROWUPDATED].getBoolean(); }
public void setValue(int theValue)
public void setValue(String theValue) throws StandardException
public void setValue(int theValue) { value = theValue; isnull = false; }
value = theValue; isnull = false;
if (theValue == null) { value = 0; isnull = true; } else { try { value = Integer.valueOf(theValue.trim()).intValue(); } catch (NumberFormatException nfe) { throw invalidFormat(); } isnull = false; }
public void setValue(int theValue) { value = theValue; isnull = false; }
if (numRespostasAguardando > 0)
if (numRespostasAguardando > 0) {
public void recusouAumentoAposta(Jogador j) { // Notifica o estrategia estrategia.recusouAumentoAposta(j.getPosicao()); // Se estivermos aguardando resposta, contabiliza if (numRespostasAguardando > 0) numRespostasAguardando--; }
Thread.yield(); }
public void recusouAumentoAposta(Jogador j) { // Notifica o estrategia estrategia.recusouAumentoAposta(j.getPosicao()); // Se estivermos aguardando resposta, contabiliza if (numRespostasAguardando > 0) numRespostasAguardando--; }
Thread t = new Thread(this);
public void vez(Jogador j, boolean podeFechada) { if (this.equals(j)) { // D um tempinho, pra fingir que est "pensando" try { Thread.sleep(Math.abs(random.nextInt()) % 250 + 200); } catch (InterruptedException e) { // Nada, apenas timing... } // Atualiza a situao do jogo (incluindo as cartas na mo) ...
try { Thread.sleep(50); } catch (InterruptedException e) { }
Thread.yield();
public void vez(Jogador j, boolean podeFechada) { if (this.equals(j)) { // D um tempinho, pra fingir que est "pensando" try { Thread.sleep(Math.abs(random.nextInt()) % 250 + 200); } catch (InterruptedException e) { // Nada, apenas timing... } // Atualiza a situao do jogo (incluindo as cartas na mo) ...
atualizaSituacaoJogo();
public void vez(Jogador j, boolean podeFechada) { if (this.equals(j)) { // D um tempinho, pra fingir que est "pensando" try { Thread.sleep(Math.abs(random.nextInt()) % 250 + 200); } catch (InterruptedException e) { // Nada, apenas timing... } // Atualiza a situao do jogo (incluindo as cartas na mo) ...
source.markRowAsDeleted();
boolean collectAffectedRows() throws StandardException { DataValueDescriptor rlColumn; RowLocation baseRowLocation; boolean rowsFound = false; if(cascadeDelete) row = getNextRowCore(source); while ( row != null ) { /* By convention, the last column for a delete contains a SQLRef * containing the RowLoc...
source.markRowAsDeleted();
void deleteDeferredRows() throws StandardException { DataValueDescriptor rlColumn; RowLocation baseRowLocation; ExecRow deferredRLRow = null; deferredBaseCC = tc.openCompiledConglomerate(false, tc.OPENMODE_FORUPDATE|tc.OPENMODE_SECONDARY_LOCKED, lockMode, TransactionCont...
protected DMLWriteResultSet(Activation activation, ConstantAction constantAction)
protected DMLWriteResultSet(Activation activation)
protected DMLWriteResultSet(Activation activation, ConstantAction constantAction) throws StandardException { super(activation); this.constantAction = (WriteCursorConstantAction) constantAction; baseRowReadMap = this.constantAction.getBaseRowReadMap(); streamStorableHeapColIds = this.constantAction.getStreamStorab...
super(activation); this.constantAction = (WriteCursorConstantAction) constantAction; baseRowReadMap = this.constantAction.getBaseRowReadMap(); streamStorableHeapColIds = this.constantAction.getStreamStorableHeapColIds(); TransactionController tc = activation.getTransactionController(); if (! (constantAction instanc...
this(activation, activation.getConstantAction());
protected DMLWriteResultSet(Activation activation, ConstantAction constantAction) throws StandardException { super(activation); this.constantAction = (WriteCursorConstantAction) constantAction; baseRowReadMap = this.constantAction.getBaseRowReadMap(); streamStorableHeapColIds = this.constantAction.getStreamStorab...
commandTable.put("readsecmecandsecchkcd", new Integer(READ_SECMEC_SECCHKCD));
private static void init() { commandTable.put("createdssrequest", new Integer(CREATE_DSS_REQUEST)); commandTable.put("createdssobject", new Integer(CREATE_DSS_OBJECT)); commandTable.put("createdssreply", new Integer(CREATE_DSS_REPLY)); commandTable.put("enddss", new Integer(END_DSS)); commandTable.put("enddss", n...
case READ_SECMEC_SECCHKCD: readSecMecAndSECCHKCD(); break;
private void processCommand() throws IOException, DRDAProtocolException { Integer icmd = (Integer)commandTable.get(tkn.sval.toLowerCase(Locale.ENGLISH)); if (icmd == null) { System.err.println("Unknown command, " + tkn.sval + " in line " + tkn.lineno()); System.exit(1); } int cmd = icmd.intValue(); int...
put (new Integer (CodePoint.QRYCLSRLS), "QRYCLSRLS");
CodePointNameTable () { put (new Integer (CodePoint.ABNUOWRM), "ABNUOWRM"); put (new Integer (CodePoint.ACCRDB), "ACCRDB"); put (new Integer (CodePoint.ACCRDBRM), "ACCRDBRM"); put (new Integer (CodePoint.ACCSEC), "ACCSEC"); put (new Integer (CodePoint.ACCSECRD), "ACCSECRD"); put (new Integer (CodeP...
protected DDMReader(CcsidManager ccsidManager, InputStream inputStream)
protected DDMReader (DRDAConnThread agent, DssTrace dssTrace)
protected DDMReader(CcsidManager ccsidManager, InputStream inputStream) { buffer = new byte[DEFAULT_BUFFER_SIZE]; ddmCollectionLenStack = new long[MAX_MARKS_NESTING]; this.ccsidManager = ccsidManager; this.inputStream = inputStream; initialize(null, null); // turn off tracing internalTrace = false; }
this.ccsidManager = ccsidManager; this.inputStream = inputStream; initialize(null, null); internalTrace = false;
initialize(agent, dssTrace);
protected DDMReader(CcsidManager ccsidManager, InputStream inputStream) { buffer = new byte[DEFAULT_BUFFER_SIZE]; ddmCollectionLenStack = new long[MAX_MARKS_NESTING]; this.ccsidManager = ccsidManager; this.inputStream = inputStream; initialize(null, null); // turn off tracing internalTrace = false; }
ps.setBigDecimal(parameterIndex,new BigDecimal(bdString));
BigDecimal bd = (bdString == null) ? null : new BigDecimal(bdString); ps.setBigDecimal(parameterIndex, bd);
public static void setBigDecimalString(PreparedStatement ps, int parameterIndex, String bdString) throws SQLException{ switch(representation){ case BIGDECIMAL_REPRESENTATION: ps.setBigDecimal(parameterIndex,new BigDecimal(bdString)); break; case STRING_REPRESENTATION: //setString is used since setBigDe...
ps.setObject(parameterIndex,new BigDecimal(objectString));
BigDecimal bd = (objectString == null) ? null : new BigDecimal(objectString); ps.setObject(parameterIndex,bd);
public static void setObjectString(PreparedStatement ps, int parameterIndex, String objectString) throws SQLException{ switch(representation){ case BIGDECIMAL_REPRESENTATION: ps.setObject(parameterIndex,new BigDecimal(objectString)); break; case STRING_REPRESENTATION: ps.setObject(parameterIndex,object...
public static void dumpRS(ResultSet s) throws SQLException
public static void dumpRS(ResultSet s) throws SQLException, UnsupportedEncodingException
public static void dumpRS(ResultSet s) throws SQLException { if (s == null) { System.out.println("<NULL>"); return; } ResultSetMetaData rsmd = s.getMetaData(); // Get the number of columns in the result set int numCols = rsmd.getColumnCount(); if (numCols <= 0) { System.out.println("(no columns!)"); re...
if (s.getBytes(i) != null) row.append(new String(s.getBytes(i)));
if (s.getBytes(i) != null) row.append(s.getBytes(i).toString());
public static void dumpRS(ResultSet s) throws SQLException { if (s == null) { System.out.println("<NULL>"); return; } ResultSetMetaData rsmd = s.getMetaData(); // Get the number of columns in the result set int numCols = rsmd.getColumnCount(); if (numCols <= 0) { System.out.println("(no columns!)"); re...
ps.setBytes(1, "cbd1 not null".getBytes()); ps.setBytes(2, "cbd2 not null".getBytes()); ps.setBytes(3, "vcbd1 not null".getBytes()); ps.setBytes(4, "vcbd2 not null".getBytes()); ps.setBytes(5, "lvcbd1 not null".getBytes()); ps.setBytes(6, "lvcbd2 not null".getBytes()); ps.setBytes(7, "blob1 not null".getBytes()); ps.se...
ps.setBytes(1, "cbd1 not null".getBytes("US-ASCII")); ps.setBytes(2, "cbd2 not null".getBytes("US-ASCII")); ps.setBytes(3, "vcbd1 not null".getBytes("US-ASCII")); ps.setBytes(4, "vcbd2 not null".getBytes("US-ASCII")); ps.setBytes(5, "lvcbd1 not null".getBytes("US-ASCII")); ps.setBytes(6, "lvcbd2 not null".getBytes("US-...
public static void testCharForBitDataCoalesce( Connection conn) throws Throwable { try { Statement s = conn.createStatement(); PreparedStatement ps; try { s.executeUpdate("drop table tC"); } catch(Exception ex) {} s.executeUpdate("create table tC (cbd1 char(254) for bit data, cbd2 char(40) for bit dat...
ps.setBytes(3, "vcbd1 not null but vcbd2 is".getBytes());
ps.setBytes(3, "vcbd1 not null but vcbd2 is".getBytes("US-ASCII"));
public static void testCharForBitDataCoalesce( Connection conn) throws Throwable { try { Statement s = conn.createStatement(); PreparedStatement ps; try { s.executeUpdate("drop table tC"); } catch(Exception ex) {} s.executeUpdate("create table tC (cbd1 char(254) for bit data, cbd2 char(40) for bit dat...
ps.setBytes(2, "cbd2 not null but cbd1 is".getBytes());
ps.setBytes(2, "cbd2 not null but cbd1 is".getBytes("US-ASCII"));
public static void testCharForBitDataCoalesce( Connection conn) throws Throwable { try { Statement s = conn.createStatement(); PreparedStatement ps; try { s.executeUpdate("drop table tC"); } catch(Exception ex) {} s.executeUpdate("create table tC (cbd1 char(254) for bit data, cbd2 char(40) for bit dat...
ps.setBytes(4, "vcbd2 not null but vcbd1 is".getBytes()); ps.setBytes(5, "lvcbd1 not null again".getBytes()); ps.setBytes(6, "lvcbd2 not null again".getBytes()); ps.setBytes(7, "blob1 not null again".getBytes()); ps.setBytes(8, "blob2 not null again".getBytes());
ps.setBytes(4, "vcbd2 not null but vcbd1 is".getBytes("US-ASCII")); ps.setBytes(5, "lvcbd1 not null again".getBytes("US-ASCII")); ps.setBytes(6, "lvcbd2 not null again".getBytes("US-ASCII")); ps.setBytes(7, "blob1 not null again".getBytes("US-ASCII")); ps.setBytes(8, "blob2 not null again".getBytes("US-ASCII"));
public static void testCharForBitDataCoalesce( Connection conn) throws Throwable { try { Statement s = conn.createStatement(); PreparedStatement ps; try { s.executeUpdate("drop table tC"); } catch(Exception ex) {} s.executeUpdate("create table tC (cbd1 char(254) for bit data, cbd2 char(40) for bit dat...
if (castOperand.isParameterNode())
if (castOperand.requiresTypeFromContext())
public void bindCastNodeOnly() throws StandardException { /* ** The result type is always castTarget. */ setType(castTarget); destCTI = castTarget.getTypeId(); sourceCTI = castOperand.getTypeId(); /* ** If it is a java cast, do some work to make sure ** the classes are ok and that they are compatible */ i...
((ParameterNode) castOperand).setDescriptor(castTarget);
castOperand.setType(castTarget);
void bindParameter() throws StandardException { ((ParameterNode) castOperand).setDescriptor(castTarget); }
else if (castOperand.isParameterNode())
else if (castOperand.requiresTypeFromContext())
public void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException { castOperand.generateExpression(acb, mb); /* No need to generate code for null constants */ if (castOperand instanceof UntypedNullConstantNode) { return; } /* HACK ALERT. When casting a para...
public static float normalizeREAL(double v) throws StandardException { if ( (Double.isNaN(v) || Double.isInfinite(v)) ||
public static float normalizeREAL(float v) throws StandardException { if ( (Float.isNaN(v) || Float.isInfinite(v)) ||
public static float normalizeREAL(double v) throws StandardException { // can't just cast it to float and call normalizeFloat(float) since casting can round down to 0.0 if ( (Double.isNaN(v) || Double.isInfinite(v)) || ((v < Limits.DB2_SMALLEST_REAL) || (v > Limits.DB2_LARGEST_REAL)) ||...
if (v == 0.0d) v = 0.0d;
if (v == 0.0f) v = 0.0f;
public static float normalizeREAL(double v) throws StandardException { // can't just cast it to float and call normalizeFloat(float) since casting can round down to 0.0 if ( (Double.isNaN(v) || Double.isInfinite(v)) || ((v < Limits.DB2_SMALLEST_REAL) || (v > Limits.DB2_LARGEST_REAL)) ||...
return (float)v; }
return v; }
public static float normalizeREAL(double v) throws StandardException { // can't just cast it to float and call normalizeFloat(float) since casting can round down to 0.0 if ( (Double.isNaN(v) || Double.isInfinite(v)) || ((v < Limits.DB2_SMALLEST_REAL) || (v > Limits.DB2_LARGEST_REAL)) ||...
utilInstance.initConnections();
utilInstance.initFromEnvironment();
public void runMe(LocalizedOutput log, LocalizedOutput out, BufferedInputStream infile) { utilMain utilInstance; LocalizedInput is; is = LocalizedResource.getInstance().getNewInput(infile); LocalizedInput [] in = { is }; out.println("--------------"+file+"-----------------"); utilInstance = new util...
throw SQLExceptionFactory.notImplemented ("isPoolable ()");
try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "isPoolable"); } checkForClosedStatement(); return isPoolable; } } catch (SqlException se) { throw se.getSQLException(); }
public boolean isPoolable() throws SQLException{ throw SQLExceptionFactory.notImplemented ("isPoolable ()"); }
throws SQLException{ throw SQLExceptionFactory.notImplemented ("setPoolable (boolean)");
throws SQLException { try { synchronized (connection_) { if (agent_.loggingEnabled()) { agent_.logWriter_.traceEntry(this, "setPoolable", poolable); } checkForClosedStatement(); isPoolable = poolable; } } catch (SqlException se) { throw se.getSQLException(); }
public void setPoolable(boolean poolable) throws SQLException{ throw SQLExceptionFactory.notImplemented ("setPoolable (boolean)"); }
public Clob(Agent agent, java.io.Reader reader, int length) {
public Clob(Agent agent, String string) {
public Clob(Agent agent, java.io.Reader reader, int length) { this(agent); sqlLength_ = length; lengthObtained_ = true; characterStream_ = reader; dataType_ |= CHARACTER_STREAM; }
sqlLength_ = length;
string_ = string; sqlLength_ = string_.length();
public Clob(Agent agent, java.io.Reader reader, int length) { this(agent); sqlLength_ = length; lengthObtained_ = true; characterStream_ = reader; dataType_ |= CHARACTER_STREAM; }
characterStream_ = reader; dataType_ |= CHARACTER_STREAM;
dataType_ |= STRING;
public Clob(Agent agent, java.io.Reader reader, int length) { this(agent); sqlLength_ = length; lengthObtained_ = true; characterStream_ = reader; dataType_ |= CHARACTER_STREAM; }
costEstimate = getFinalCostEstimate();
private int getScanArguments(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException { int rclSize = resultColumns.size(); FormatableBitSet referencedCols = new FormatableBitSet(rclSize); int erdNumber = -1; int numSet = 0; for (int index = 0; index < rclSize; index++) { R...
tableName.getFullTableName());
origTableName.getFullTableName());
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException { TableDescriptor tableDescriptor = bindTableDescriptor(); if (tableDescriptor.getTableType() == TableDescriptor.VTI_TYPE) { ResultSetNode vtiNode = getNodeFactory().mapTableAsVTI( ...
if (tableDescriptor != null) { this.tableDescriptor = tableDescriptor; } else
if (tableDescriptor == null)
private TableDescriptor bindTableDescriptor() throws StandardException { String schemaName = tableName.getSchemaName(); SchemaDescriptor sd = getSchemaDescriptor(schemaName); tableDescriptor = getTableDescriptor(tableName.getTableName(), sd); if (tableDescriptor != null) { this.tableDescriptor = tableDescripto...
String ourSchemaName = tableName.getSchemaName();
String ourSchemaName = getOrigTableName().getSchemaName();
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException { String ourSchemaName = tableName.getSchemaName(); String fullName = (schemaName != null) ? (schemaName + '.' + name) : name; /* If an exact string match is required then: * o If schema name spec...
if (! schemaName.equals(tableDescriptor.getSchemaDescriptor().getSchemaName()))
if (tableName.equals(origTableName) && ! schemaName.equals(tableDescriptor.getSchemaDescriptor().getSchemaName()))
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException { String ourSchemaName = tableName.getSchemaName(); String fullName = (schemaName != null) ? (schemaName + '.' + name) : name; /* If an exact string match is required then: * o If schema name spec...
if (! getExposedName().equals(tableName.getTableName()))
if (! getExposedName().equals(getOrigTableName().getTableName()))
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException { String ourSchemaName = tableName.getSchemaName(); String fullName = (schemaName != null) ? (schemaName + '.' + name) : name; /* If an exact string match is required then: * o If schema name spec...
if (! getExposedName().equals(tableName.getSchemaName() + "." + name))
if (! getExposedName().equals(getOrigTableName().getSchemaName() + "." + name))
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException { String ourSchemaName = tableName.getSchemaName(); String fullName = (schemaName != null) ? (schemaName + '.' + name) : name; /* If an exact string match is required then: * o If schema name spec...
public ColumnReference getColumnOperand(Optimizable optTable)
public ColumnReference getColumnOperand( Optimizable optTable, int columnPosition)
public ColumnReference getColumnOperand(Optimizable optTable) { ColumnReference cr; if (leftOperand instanceof ColumnReference) { /* ** The left operand is a column reference. ** Is it the correct column? */ cr = (ColumnReference) leftOperand; if (cr.getTableNumber() == optTable.getTableNumber()) { ...
ColumnReference cr;
FromTable ft = (FromTable) optTable;
public ColumnReference getColumnOperand(Optimizable optTable) { ColumnReference cr; if (leftOperand instanceof ColumnReference) { /* ** The left operand is a column reference. ** Is it the correct column? */ cr = (ColumnReference) leftOperand; if (cr.getTableNumber() == optTable.getTableNumber()) { ...
if (leftOperand instanceof ColumnReference) { cr = (ColumnReference) leftOperand; if (cr.getTableNumber() == optTable.getTableNumber()) { return cr; } } if (rightOperand instanceof ColumnReference) { cr = (ColumnReference) rightOperand; if (cr.getTableNumber() == optTable.getTableNumber()) { return cr; } } retur...
return getColumnOperand(ft.getTableNumber(), columnPosition);
public ColumnReference getColumnOperand(Optimizable optTable) { ColumnReference cr; if (leftOperand instanceof ColumnReference) { /* ** The left operand is a column reference. ** Is it the correct column? */ cr = (ColumnReference) leftOperand; if (cr.getTableNumber() == optTable.getTableNumber()) { ...