rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
execCmdDumpResults(RuntimeinfoLocaleCmd);
ExecProcUtil.execCmdDumpResults(RuntimeinfoLocaleCmd,vCmd,bos);
public static void main (String args[]) throws Exception { if ((System.getProperty("java.vm.name") != null) && System.getProperty("java.vm.name").equals("J9")) jvm = jvm.getJvm("j9_13"); else jvm = jvm.getJvm("currentjvm"); // ensure compatibility vCmd = jvm.getCommandLine(); try { ij.getPropertyArg(args);...
java.sql.Date date) throws SqlException {
java.sql.Date date) throws SqlException,UnsupportedEncodingException {
public static final int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException { int year = date.getYear() + 1900; if (year > 9999) { throw new SqlException(null, ...
byte[] dateBytes = (new String(dateChars)).getBytes();
byte[] dateBytes = (new String(dateChars)).getBytes(Typdef.UTF8ENCODING);
public static final int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException { int year = date.getYear() + 1900; if (year > 9999) { throw new SqlException(null, ...
java.sql.Date date) throws SqlException {
java.sql.Date date) throws SqlException, UnsupportedEncodingException {
public static final int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException { int year = date.getYear() + 1900; if (year > 9999) { throw new SqlException(null,...
byte[] timestampBytes = (new String(timestampChars)).getBytes();
byte[] timestampBytes = (new String(timestampChars)).getBytes(Typdef.UTF8ENCODING);
public static final int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException { int year = date.getYear() + 1900; if (year > 9999) { throw new SqlException(null,...
java.sql.Time time) {
java.sql.Time time) throws UnsupportedEncodingException {
public static final int timeToTimeBytes(byte[] buffer, int offset, java.sql.Time time) { int hour = time.getHours(); int minute = time.getMinutes(); int second = time.getSeconds(); char[] timeChars = ne...
byte[] timeBytes = (new String(timeChars)).getBytes();
byte[] timeBytes = (new String(timeChars)).getBytes(Typdef.UTF8ENCODING);
public static final int timeToTimeBytes(byte[] buffer, int offset, java.sql.Time time) { int hour = time.getHours(); int minute = time.getMinutes(); int second = time.getSeconds(); char[] timeChars = ne...
java.sql.Time time) {
java.sql.Time time) throws UnsupportedEncodingException {
public static final int timeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time) { int hour = time.getHours(); int minute = time.getMinutes(); int second = time.getSeconds(); char[]...
byte[] timestampBytes = (new String(timestampChars)).getBytes();
byte[] timestampBytes = (new String(timestampChars)).getBytes(Typdef.UTF8ENCODING);
public static final int timeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time) { int hour = time.getHours(); int minute = time.getMinutes(); int second = time.getSeconds(); char[]...
java.sql.Timestamp timestamp) throws SqlException {
java.sql.Timestamp timestamp) throws SqlException,UnsupportedEncodingException {
public static final int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException { int year = timestamp.getYear() + 1900; if (year > 9999) { throw new Sql...
byte[] dateBytes = (new String(dateChars)).getBytes();
byte[] dateBytes = (new String(dateChars)).getBytes(Typdef.UTF8ENCODING);
public static final int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException { int year = timestamp.getYear() + 1900; if (year > 9999) { throw new Sql...
java.sql.Timestamp timestamp) {
java.sql.Timestamp timestamp) throws UnsupportedEncodingException {
public static final int timestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) { int hour = timestamp.getHours(); int minute = timestamp.getMinutes(); int second = timestamp.ge...
byte[] timeBytes = (new String(timeChars)).getBytes();
byte[] timeBytes = (new String(timeChars)).getBytes(Typdef.UTF8ENCODING);
public static final int timestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) { int hour = timestamp.getHours(); int minute = timestamp.getMinutes(); int second = timestamp.ge...
java.sql.Timestamp timestamp) throws SqlException {
java.sql.Timestamp timestamp) throws SqlException,UnsupportedEncodingException {
public static final int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException { int year = timestamp.getYear() + 1900; if (year > 9999) { ...
byte[] timestampBytes = (new String(timestampChars)).getBytes();
byte[] timestampBytes = (new String(timestampChars)).getBytes(Typdef.UTF8ENCODING);
public static final int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException { int year = timestamp.getYear() + 1900; if (year > 9999) { ...
getAuthorizer(activation).authorize(Authorizer.SQL_CALL_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_CALL_OP);
public ResultSet getCallStatementResultSet(GeneratedMethod methodCall, Activation activation) throws StandardException { getAuthorizer(activation).authorize(Authorizer.SQL_CALL_OP); return new CallStatementResultSet(methodCall, activation); }
getAuthorizer(activation).authorize(Authorizer.SQL_DDL_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_DDL_OP);
public ResultSet getDDLResultSet(Activation activation) throws StandardException { getAuthorizer(activation).authorize(Authorizer.SQL_DDL_OP); return getMiscResultSet( activation); }
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getDeleteCascadeResultSet(NoPutResultSet source, int constantActionItem, ResultSet[] dependentResultSets, String resultSetId) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_O...
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getDeleteCascadeUpdateResultSet(NoPutResultSet source, GeneratedMethod checkGM, int constantActionItem, int rsdItem) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); retu...
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getDeleteResultSet(NoPutResultSet source) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); return new DeleteResultSet(source, activation ); }
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getDeleteVTIResultSet(NoPutResultSet source) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); return new DeleteVTIResultSet(source, activation); }
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getInsertResultSet(NoPutResultSet source, GeneratedMethod checkGM) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); return new InsertResultSet(source, checkGM, activation ); }
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getInsertVTIResultSet(NoPutResultSet source, NoPutResultSet vtiRS ) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); return new InsertVTIResultSet(source, vtiRS, activation ); }
getAuthorizer(activation).authorize(Authorizer.SQL_ARBITARY_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_ARBITARY_OP);
public ResultSet getMiscResultSet(Activation activation) throws StandardException { getAuthorizer(activation).authorize(Authorizer.SQL_ARBITARY_OP); return new MiscResultSet(activation); }
getAuthorizer(activation).authorize(Authorizer.SQL_ARBITARY_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_ARBITARY_OP);
public ResultSet getSetTransactionResultSet(Activation activation) throws StandardException { getAuthorizer(activation).authorize(Authorizer.SQL_ARBITARY_OP); return new SetTransactionResultSet(activation); }
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getUpdateResultSet(NoPutResultSet source, GeneratedMethod checkGM) throws StandardException { Activation activation = source.getActivation(); //The stress test failed with null pointer exception in here once and then //it didn't happen again. It can be a jit problem because after this nu...
getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP);
getAuthorizer(activation).authorize(activation, Authorizer.SQL_WRITE_OP);
public ResultSet getUpdateVTIResultSet(NoPutResultSet source) throws StandardException { Activation activation = source.getActivation(); getAuthorizer(activation).authorize(Authorizer.SQL_WRITE_OP); return new UpdateVTIResultSet(source, activation); }
break;
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException { switch ( action ) { /* creating or dropping another publication won't affect * this view. so we allow these actions. * We don't care about creating or dropping indexes or * alter table on an underlying table. ...
break;
dropViewWork(getDataDictionary(), getDataDictionary().getDependencyManager(), lcc, lcc.getTransactionExecute(), getDataDictionary().getTableDescriptor(uuid).getSchemaDescriptor(), getDataDictionary().getTableDescriptor(uuid), false); return;
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException { switch ( action ) { /* creating or dropping another publication won't affect * this view. so we allow these actions. * We don't care about creating or dropping indexes or * alter table on an underlying table. ...
HttpSession session = request.getSession();
public ActionForward fill(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ClientWebComponent cwp = new ClientWebComponent(); ActionForward mapp = cwp.getSurveyPage(request.getParameter("sid"), request.getParameter("token"...
session.removeAttribute("answers");
public ActionForward fill(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ClientWebComponent cwp = new ClientWebComponent(); ActionForward mapp = cwp.getSurveyPage(request.getParameter("sid"), request.getParameter("token"...
if(session.getAttribute("answers")==null)
if (session.getAttribute("CurrentClientSurvey") == null)
public ActionForward fillNext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
fform.getTxtAnswer()[index - 1], question);
fform.getTxtAnswer()[lastString], question); lastString++;
public ActionForward fillNext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
int tempIndex = index - 2; Field field = FieldFactory.stringField( values[tempIndex], question);
Field field = FieldFactory.stringField(values[lastString], question); lastString++;
public ActionForward fillNext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
FillForm fform = (FillForm) form; HttpSession session = request.getSession();
public ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
if(session.getAttribute("answers")==null) return mapping.findForward("invalidSession"); ArrayList answers = (ArrayList) session.getAttribute("answers"); Section section = (Section) session.getAttribute("CurrentClientSection"); Iterator iter = section.getQuestions().iterator(); int index = 1; while (iter.hasNext()) ...
ActionForward forward = fillNext(mapping, form, request, response); if(forward.getName().equals("answers")) forward = mapping.findForward("finish");
public ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
cwp.persistAnswers(session); return mapping.findForward("finish");
cwp.persistAnswers(request.getSession()); return forward;
public ActionForward finish(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { FillForm fform = (FillForm) form; HttpSession session = request.getSession(); if(session.getAttribute("answers")==null) return mapping.findForw...
try { rs.absolute(0); System.out.println("absolute(0) expected to fail"); passed = false; } catch (SQLException sqle) { passed = passed && checkException(sqle, "X0X86"); }
static boolean scrollInsensitiveNegative( Connection conn) throws SQLException { boolean passed = true; ResultSet rs; SQLWarning warning; Statement s_i_r = null; // insensitive, read only s_i_r = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); // We should not hav...
int [] joinOrder = null; if (doAdd)
if (numOptimizables > 1)
protected void addOrLoadBestPlanMappings(boolean doAdd, Optimizer outerOptimizer) throws StandardException { // First we save this OptimizerImpl's best join order. int [] joinOrder = null; if (doAdd) { // If the savedJoinOrder map already exists, search for the // join order for the target optimizer and reuse...
if (savedJoinOrders == null) savedJoinOrders = new HashMap();
int [] joinOrder = null; if (doAdd) { if (savedJoinOrders == null) savedJoinOrders = new HashMap(); else joinOrder = (int[])savedJoinOrders.get(outerOptimizer); if (joinOrder == null) joinOrder = new int[numOptimizables]; for (int i = 0; i < bestJoinOrder.length; i++) joinOrder[i] = bestJoinOrder[i]; savedJoinO...
protected void addOrLoadBestPlanMappings(boolean doAdd, Optimizer outerOptimizer) throws StandardException { // First we save this OptimizerImpl's best join order. int [] joinOrder = null; if (doAdd) { // If the savedJoinOrder map already exists, search for the // join order for the target optimizer and reuse...
if (joinOrder == null) joinOrder = new int[numOptimizables]; for (int i = 0; i < bestJoinOrder.length; i++) joinOrder[i] = bestJoinOrder[i]; savedJoinOrders.put(outerOptimizer, joinOrder); } else { if (savedJoinOrders == null) return; joinOrder = (int[])savedJoinOrders.get(outerOptimizer); if (joinOrder == nu...
for (int i = 0; i < joinOrder.length; i++) bestJoinOrder[i] = joinOrder[i]; }
protected void addOrLoadBestPlanMappings(boolean doAdd, Optimizer outerOptimizer) throws StandardException { // First we save this OptimizerImpl's best join order. int [] joinOrder = null; if (doAdd) { // If the savedJoinOrder map already exists, search for the // join order for the target optimizer and reuse...
parent.consolePropertyMessage("DRDA_ConnNumber.I",
if (parent.getLogConnections()) parent.consolePropertyMessage("DRDA_ConnNumber.I",
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...
System.out.print("SQLSTATE("+se.getSQLState()+"):");
System.out.println("SQLSTATE("+se.getSQLState()+"):"+se.getMessage());
static private void dumpSQLExceptions (SQLException se) { System.out.println("FAIL -- unexpected exception: " + se.toString()); se.printStackTrace(); while (se != null) { System.out.print("SQLSTATE("+se.getSQLState()+"):"); se = se.getNextException(); } }
dumpSQLExceptions(e);
TestUtil.dumpSQLExceptions(e,true);
private static void insertDataUsingAsciiStream(PreparedStatement ps, int intValue, String fileName, int maxValueAllowed) throws Exception{ File file = new File(fileName); InputStream fileIn = new FileInputStream(file); System.out.println("===> testing(using setAsciiStream) " + fileName + " length = " + file.leng...
dumpSQLExceptions(e);
TestUtil.dumpSQLExceptions(e,true);
private static void insertDataUsingCharacterStream(PreparedStatement ps, int intValue, String fileName, int maxValueAllowed) throws Exception{ File file = new File(fileName); InputStream fileIn = new FileInputStream(file); Reader filer = new InputStreamReader(fileIn); System.out.println("===> testing(using set...
boolean forLongVarChar)
int tblType)
private static void insertDataUsingConcat(Statement stmt, int intValue, int maxValueAllowed, boolean blankPadding, boolean forLongVarChar) throws Exception{ String sql; if (forLongVarChar) sql = "insert into testLongVarChars select " + intValue + ", a||b||"; else sql = "insert into testVarChar select "+ intVa...
if (forLongVarChar) sql = "insert into testLongVarChars select " + intValue + ", a||b||"; else sql = "insert into testVarChar select "+ intValue + ", c||d||";
switch(tblType) { case LONGVARCHAR: sql = "insert into testLongVarChars select " + intValue + ", a||b||"; break; case CLOB: sql = "insert into testClob select "+ intValue + ", c||d||"; break; default: sql = "insert into testVarChar select "+ intValue + ", c||d||"; }
private static void insertDataUsingConcat(Statement stmt, int intValue, int maxValueAllowed, boolean blankPadding, boolean forLongVarChar) throws Exception{ String sql; if (forLongVarChar) sql = "insert into testLongVarChars select " + intValue + ", a||b||"; else sql = "insert into testVarChar select "+ intVa...
streamTest5(conn, 100000);
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...
streamTest14(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...
insertDataUsingConcat(stmt, 5, Limits.DB2_VARCHAR_MAXWIDTH, true, false);
insertDataUsingConcat(stmt, 5, Limits.DB2_VARCHAR_MAXWIDTH, true, VARCHAR);
private static void streamTest12(Connection conn) { ResultSet rs; Statement stmt; //The following 2 files are for testing the truncation in varchar. //only non-blank character truncation will throw an exception for varchars. //max value allowed in varchars is 32672 characters long String fileName1 = "extin/char3...
insertDataUsingConcat(stmt, 10, Limits.DB2_VARCHAR_MAXWIDTH, false, false);
insertDataUsingConcat(stmt, 10, Limits.DB2_VARCHAR_MAXWIDTH, false, VARCHAR);
private static void streamTest12(Connection conn) { ResultSet rs; Statement stmt; //The following 2 files are for testing the truncation in varchar. //only non-blank character truncation will throw an exception for varchars. //max value allowed in varchars is 32672 characters long String fileName1 = "extin/char3...
if (SanityManager.DEBUG) { if (SanityManager.DEBUG_ON(TEST_REENCRYPT_CRASH_BEFORE_COMMT)) { throw StandardException.newException( SQLState.LOG_IO_ERROR, new IOException(TEST_REENCRYPT_CRASH_BEFORE_COMMT)); } }
public void configureDatabaseForEncryption(Properties properties, boolean reEncrypt, CipherFactory newCipherFactory) throws StandardException { // check if the database can be encrypted. canEncrypt...
private boolean hasLobColumns() throws SQLException
protected boolean hasLobColumns() throws SQLException
private boolean hasLobColumns() throws SQLException { ResultSetMetaData rsmd = rs.getMetaData(); int ncols = rsmd.getColumnCount(); for (int i = 1; i <= ncols; i++) { int type = rsmd.getColumnType(i); if (type == Types.BLOB || type == Types.CLOB) return true; } return false; }
qryrtndta = true; qryscrorn = CodePoint.QRYSCRREL; qryrownbr = 1;
protected void setOPNQRYOptions(int blksize, int qryblkctl, int maxblkext, int outovropt,int qryrowset,int qryclsimpl) { this.blksize = blksize; setQryprctyp(qryblkctl); this.maxblkext = maxblkext; this.outovropt = outovropt; this.qryrowset = qryrowset; this.qryclsimp = (qryclsimpl == CodePoint.QRYCLSIMP_SERVE...
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees);
privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees, false);
public QueryTreeNode bind() throws StandardException { privileges = (PrivilegeNode) privileges.bind( new HashMap(), grantees); return this; } // end of bind
if (o instanceof Blob) { Blob b = (Blob) o; long blobLength = b.length();
if (o instanceof EXTDTAInputStream) { EXTDTAInputStream stream = (EXTDTAInputStream) o; long lobLength = stream.length();
void writeEXTDTA (DRDAStatement stmt) throws SQLException, DRDAProtocolException { ArrayList extdtaValues = stmt.getExtDtaObjects(); // build the EXTDTA data, if necessary if (extdtaValues == null) return; boolean chainFlag, chainedWithSameCorrelator; boolean writeNullByte = false; for (int i = 0; i < extd...
(int) Math.min(blobLength,
(int) Math.min(lobLength,
void writeEXTDTA (DRDAStatement stmt) throws SQLException, DRDAProtocolException { ArrayList extdtaValues = stmt.getExtDtaObjects(); // build the EXTDTA data, if necessary if (extdtaValues == null) return; boolean chainFlag, chainedWithSameCorrelator; boolean writeNullByte = false; for (int i = 0; i < extd...
b.getBinaryStream (),
stream,
void writeEXTDTA (DRDAStatement stmt) throws SQLException, DRDAProtocolException { ArrayList extdtaValues = stmt.getExtDtaObjects(); // build the EXTDTA data, if necessary if (extdtaValues == null) return; boolean chainFlag, chainedWithSameCorrelator; boolean writeNullByte = false; for (int i = 0; i < extd...
} else if (o instanceof Clob) { Clob c = (Clob) o; long[] outlen = {-1}; ByteArrayInputStream unicodeStream = convertClobToUnicodeStream(c, outlen); writer.writeScalarStream (chainedWithSameCorrelator, CodePoint.EXTDTA, (int) Math.min(outlen[0], Integer.MAX_VALUE), unicodeStream, writeNullByte); }
try { if (stream != null) stream.close(); } catch (IOException e) { Util.javaException(e); } }
void writeEXTDTA (DRDAStatement stmt) throws SQLException, DRDAProtocolException { ArrayList extdtaValues = stmt.getExtDtaObjects(); // build the EXTDTA data, if necessary if (extdtaValues == null) return; boolean chainFlag, chainedWithSameCorrelator; boolean writeNullByte = false; for (int i = 0; i < extd...
writeFdocaVal(i,rs.getBlob(i),drdaType, precision,scale,rs.wasNull(),stmt); break;
private boolean writeFDODTA (DRDAStatement stmt) throws DRDAProtocolException, SQLException { boolean hasdata = false; int blksize = stmt.getBlksize() > 0 ? stmt.getBlksize() : CodePoint.QRYBLKSZ_MAX; long rowCount = 0; ResultSet rs =null; boolean moreData = (stmt.getQryprctyp() == CodePoint.LMTBLKPRC); ...
writeFdocaVal(i,rs.getClob(i),drdaType,
EXTDTAInputStream extdtaStream= EXTDTAInputStream.getEXTDTAStream(rs, i, drdaType); writeFdocaVal(i,extdtaStream, drdaType,
private boolean writeFDODTA (DRDAStatement stmt) throws DRDAProtocolException, SQLException { boolean hasdata = false; int blksize = stmt.getBlksize() > 0 ? stmt.getBlksize() : CodePoint.QRYBLKSZ_MAX; long rowCount = 0; ResultSet rs =null; boolean moreData = (stmt.getQryprctyp() == CodePoint.LMTBLKPRC); ...
valLength = ((Blob) val).length();
valLength = ((EXTDTAInputStream) val).length();
protected void writeFdocaVal(int index, Object val, int drdaType, int precision, int scale, boolean valNull, DRDAStatement stmt) throws DRDAProtocolException, SQLException { writeNullability(drdaType,valNull); if (! valNull) { int ndrdaType = drdaType | 1; long valLength = 0; switch (...
break; case FdocaConstants.DRDA_TYPE_NLOBCMIXED: valLength = ((Clob) val).length(); if (valLength > 0) stmt.addExtDtaObject(val,index); writer.writeExtendedLength(valLength);
protected void writeFdocaVal(int index, Object val, int drdaType, int precision, int scale, boolean valNull, DRDAStatement stmt) throws DRDAProtocolException, SQLException { writeNullability(drdaType,valNull); if (! valNull) { int ndrdaType = drdaType | 1; long valLength = 0; switch (...
private static LocalizedOutput openFile(String dir, String fileName, String suffix)
private static LocalizedOutput openFile(String dir, String fileName)
private static LocalizedOutput openFile(String dir, String fileName, String suffix) throws IOException { String filePath; String base; int dotSpot; String newFile; filePath = (dir == null) ? fileName : (dir + "/" + fileName); if (suffix != null) { dotSpot = filePath.lastIndexOf("."); if (dotSpot == -1) ...
String filePath; String base; int dotSpot; String newFile; filePath = (dir == null) ? fileName : (dir + "/" + fileName);
java.io.File file = new java.io.File(dir, fileName);
private static LocalizedOutput openFile(String dir, String fileName, String suffix) throws IOException { String filePath; String base; int dotSpot; String newFile; filePath = (dir == null) ? fileName : (dir + "/" + fileName); if (suffix != null) { dotSpot = filePath.lastIndexOf("."); if (dotSpot == -1) ...
if (suffix != null) { dotSpot = filePath.lastIndexOf("."); if (dotSpot == -1) { dotSpot = filePath.length(); } base = filePath.substring(0, dotSpot); newFile = base + suffix; } else { newFile = filePath; } return new LocalizedOutput(new FileOutputStream(newFile));
return new LocalizedOutput(new FileOutputStream(file));
private static LocalizedOutput openFile(String dir, String fileName, String suffix) throws IOException { String filePath; String base; int dotSpot; String newFile; filePath = (dir == null) ? fileName : (dir + "/" + fileName); if (suffix != null) { dotSpot = filePath.lastIndexOf("."); if (dotSpot == -1) ...
System.out.println("...running "+descr+" via "+testCase.getFile()); out = openFile(outputDir, testCase.getFile(), ".out");
String testName = testCase.getFile(); System.out.println("...running "+descr+" via "+testName); String logFileName = testName.substring(0, testName.lastIndexOf('.')); out = openFile(outputDir, logFileName + ".out");
private static void seqRunCases(Vector cases, String descr, String inputDir, String outputDir) throws FileNotFoundException, IOException, ijFatalException { LocalizedOutput out; BufferedInputStream in; mtTestCase testCase; if (cases == null) { System.out.println("...no "+descr+" being performed"); return; ...
if (leftOperand.isParameterNode())
if (leftOperand.requiresTypeFromContext())
public ValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { leftOperand = leftOperand.bindExpression(fromList, subqueryList, aggregateVector); rightOperand = rightOperand.bindExpression(fromList, subqueryList, aggregateVector); if (ope...
if (rightOperand.isParameterNode())
if (rightOperand.requiresTypeFromContext())
public ValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { leftOperand = leftOperand.bindExpression(fromList, subqueryList, aggregateVector); rightOperand = rightOperand.bindExpression(fromList, subqueryList, aggregateVector); if (ope...
((ParameterNode) leftOperand).setDescriptor(rightOperand.getTypeServices());
leftOperand.setType(rightOperand.getTypeServices());
public ValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { leftOperand = leftOperand.bindExpression(fromList, subqueryList, aggregateVector); rightOperand = rightOperand.bindExpression(fromList, subqueryList, aggregateVector); if (ope...
((ParameterNode) rightOperand).setDescriptor(leftOperand.getTypeServices());
rightOperand.setType(leftOperand.getTypeServices());
public ValueNode bindExpression( FromList fromList, SubqueryList subqueryList, Vector aggregateVector) throws StandardException { leftOperand = leftOperand.bindExpression(fromList, subqueryList, aggregateVector); rightOperand = rightOperand.bindExpression(fromList, subqueryList, aggregateVector); if (ope...
if (leftOperand.isParameterNode())
if (leftOperand.requiresTypeFromContext())
public ValueNode bindXMLExists() throws StandardException { // Check operand types. TypeId leftOperandType = leftOperand.getTypeId(); TypeId rightOperandType = rightOperand.getTypeId(); // Left operand is query expression, and must be a string. if (leftOperandType != null) { ...
((ParameterNode) leftOperand).setDescriptor(
leftOperand.setType(
public ValueNode bindXMLExists() throws StandardException { // Check operand types. TypeId leftOperandType = leftOperand.getTypeId(); TypeId rightOperandType = rightOperand.getTypeId(); // Left operand is query expression, and must be a string. if (leftOperandType != null) { ...
if (rightOperand.isParameterNode())
if (rightOperand.requiresTypeFromContext())
public ValueNode bindXMLExists() throws StandardException { // Check operand types. TypeId leftOperandType = leftOperand.getTypeId(); TypeId rightOperandType = rightOperand.getTypeId(); // Left operand is query expression, and must be a string. if (leftOperandType != null) { ...
throws StandardException
protected void initializeResultField(ExpressionClassBuilder acb, MethodBuilder mb, LocalField resultField) { }
public boolean isValid(int timeout) throws SQLException{ throw Util.notImplemented();
public final boolean isValid(int timeout) throws SQLException{ if (isClosed()) { return false; } try { return getRealConnection().isValid(timeout); } catch (SQLException sqle) { notifyException(sqle); throw sqle; }
public boolean isValid(int timeout) throws SQLException{ throw Util.notImplemented(); }
* post-commit or on a rollback this copy will be replace the container * file to bring the database back to the state before encryption * process started.
* after a checkpoint with new key or on a rollback this copy will be * replace the container file to bring the database back to the * state before encryption process started.
private StorageFile encryptContainer(RawTransaction t, ContainerKey ckey) throws StandardException { LockingPolicy cl = t.newLockingPolicy( LockingPolicy.MODE_CONTAINER, TransactionControl...
if (!currentFile.renameTo(oldFile)) {
if (!privRename(currentFile, oldFile)) {
private StorageFile encryptContainer(RawTransaction t, ContainerKey ckey) throws StandardException { LockingPolicy cl = t.newLockingPolicy( LockingPolicy.MODE_CONTAINER, TransactionControl...
if (!newFile.renameTo(currentFile)) {
if (!privRename(newFile, currentFile)) {
private StorageFile encryptContainer(RawTransaction t, ContainerKey ckey) throws StandardException { LockingPolicy cl = t.newLockingPolicy( LockingPolicy.MODE_CONTAINER, TransactionControl...
if (!oldFile.delete())
if (!privDelete(oldFile))
public void removeOldVersionOfContainers(boolean inRecovery) throws StandardException { if (inRecovery) { // find the old version of the container files // and delete them String[] files = dataFactory.getContainerNames(); if (files != nul...
if (!oldFiles[i].delete())
if (!privDelete(oldFiles[i]))
public void removeOldVersionOfContainers(boolean inRecovery) throws StandardException { if (inRecovery) { // find the old version of the container files // and delete them String[] files = dataFactory.getContainerNames(); if (files != nul...
if (oldFile.exists()) { if (currentFile.exists()) {
if (privExists(oldFile)) { if (privExists(currentFile)) {
void restoreContainer(ContainerKey containerId) throws StandardException { // get rid of the container entry from conatainer cache, // this will make sure there are no file opens on the current // container file. if (!dataFactory.getContainerCache().discard(containe...
if (!currentFile.renameTo(newFile)) {
if (!privRename(currentFile, newFile)) {
void restoreContainer(ContainerKey containerId) throws StandardException { // get rid of the container entry from conatainer cache, // this will make sure there are no file opens on the current // container file. if (!dataFactory.getContainerCache().discard(containe...
if (!oldFile.renameTo(currentFile)) {
if (!privRename(oldFile, currentFile)) {
void restoreContainer(ContainerKey containerId) throws StandardException { // get rid of the container entry from conatainer cache, // this will make sure there are no file opens on the current // container file. if (!dataFactory.getContainerCache().discard(containe...
if (newFile.exists()) {
if (privExists(newFile)) {
void restoreContainer(ContainerKey containerId) throws StandardException { // get rid of the container entry from conatainer cache, // this will make sure there are no file opens on the current // container file. if (!dataFactory.getContainerCache().discard(containe...
if (!newFile.delete())
if (!privDelete(newFile))
void restoreContainer(ContainerKey containerId) throws StandardException { // get rid of the container entry from conatainer cache, // this will make sure there are no file opens on the current // container file. if (!dataFactory.getContainerCache().discard(containe...
EmbedXAConnection40(EmbeddedDataSource40 ds, ResourceAdapter ra, String user, String password, boolean requestPassword) throws SQLException { super(ds, user, password, requestPassword); xaRes = new EmbedXAResource(this, ra); }
EmbedXAConnection40 (EmbeddedDataSource ds, ResourceAdapter ra, String user, String password, boolean requestPassword) throws SQLException { super(ds, ra, user, password, requestPassword); }
EmbedXAConnection40(EmbeddedDataSource40 ds, ResourceAdapter ra, String user, String password, boolean requestPassword) throws SQLException { super(ds, user, password, requestPassword); xaRes = new EmbedXAResource(this, ra); }
public TypeId getTypeId()
public TypeId getTypeId() throws StandardException
public TypeId getTypeId() { return (returnOutputParameter != null) ? returnOutputParameter.getTypeId() : super.getTypeId(); }
if (hostName.equals("localhost"))
for ( int i = 0; i < derby_drda_securityMechanism.length; i++)
public static void main(String[] args) throws Exception { // Load harness properties. ij.getPropertyArg(args); String hostName = TestUtil.getHostName(); if (hostName.equals("localhost")) NETWORKSERVER_PORT = 20000; else NETWORKSERVER_PORT = 1527; // "runTest()" is going to try to connect to the database th...
networkServer = new NetworkServerControl(InetAddress.getByName(hostName),NETWORKSERVER_PORT); networkServer.start(null); if (!isServerStarted(networkServer, 60)) System.exit(-1); } try { testSecMec tester = new testSecMec(consoleLogStream, originalStream, shutdownLogStream, consoleErrLogStream, originalErrStream, s...
if (derby_drda_securityMechanism[i]!=null) System.setProperty("derby.drda.securityMechanism",derby_drda_securityMechanism[i]); System.out.println("----------------------------------------------"); System.out.println("Testing with derby.drda.securityMechanism="+ System.getProperty("derby.drda.securityMechanism")); if ...
public static void main(String[] args) throws Exception { // Load harness properties. ij.getPropertyArg(args); String hostName = TestUtil.getHostName(); if (hostName.equals("localhost")) NETWORKSERVER_PORT = 20000; else NETWORKSERVER_PORT = 1527; // "runTest()" is going to try to connect to the database th...
consoleLogStream.switchOutput( shutdownLogStream ); consoleErrLogStream.switchOutput( shutdownErrLogStream ); networkServer.shutdown(); Thread.sleep(5000); consoleLogStream.switchOutput( originalStream ); consoleErrLogStream.switchOutput( originalErrStream );
try { networkServer = new NetworkServerControl(InetAddress.getByName(hostName),NETWORKSERVER_PORT); networkServer.start(null); }catch(Exception e) { if ( derby_drda_securityMechanism[i].equals("INVALID_VALUE")|| derby_drda_securityMechanism[i].equals("")) { System.out.println("EXPECTED EXCEPTION "+ e.getMessage()); con...
public static void main(String[] args) throws Exception { // Load harness properties. ij.getPropertyArg(args); String hostName = TestUtil.getHostName(); if (hostName.equals("localhost")) NETWORKSERVER_PORT = 20000; else NETWORKSERVER_PORT = 1527; // "runTest()" is going to try to connect to the database th...
getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=neelima;password=lee;securityMechanism="+SECMEC_USRIDPWD),"T4:");
if ( dbNotCreated ) { getConnectionUsingDriverManager(getJDBCUrl("wombat;create=true","user=neelima;password=lee;securityMechanism="+SECMEC_USRIDPWD),"T4:"); dbNotCreated = false; } else getConnectionUsingDriverManager(getJDBCUrl("wombat","user=neelima;password=lee;securityMechanism="+SECMEC_USRIDPWD),"T4:");
protected void runTest() { // Test cases with get connection via drivermanager and using // different security mechanisms. // Network server supports SECMEC_USRIDPWD, SECMEC_USRIDONL,SECMEC_EUSRIDPWD System.out.println("Checking security mechanism authentication with DriverManager"); getConnectionUsingDriverManag...
"has been closed", ioe.getMessage());
"has been closed.", ioe.getMessage());
public void testSelfDestructiveClob2() throws Exception { insertDefaultData(); Statement stmt = createStatement(); ResultSet rs = stmt.executeQuery( "select a,b from testClob where b = 10000"); byte[] buff = new byte[128]; // fetch row back, get the column as a clob...
cc.addRequiredSchemaPriv(name, aid, Authorizer.CREATE_SCHEMA_PRIV);
if (isPrivilegeCollectionRequired()) cc.addRequiredSchemaPriv(name, aid, Authorizer.CREATE_SCHEMA_PRIV);
public QueryTreeNode bind() throws StandardException { super.bind(); CompilerContext cc = getCompilerContext(); cc.addRequiredSchemaPriv(name, aid, Authorizer.CREATE_SCHEMA_PRIV); return this; }
insertSQL.append("\"" + resultSetMetaData_.getColumnName(column) + "\"");
insertSQL.append(quoteSqlIdentifier( resultSetMetaData_.getColumnName(column)));
private String buildInsertString() throws SqlException { int column; boolean foundOneUpdatedColumnAlready = false; StringBuffer insertSQL = new StringBuffer("INSERT INTO "); StringBuffer valuesSQL = new StringBuffer("VALUES ("); insertSQL.append(getTableName()); ins...
updateString += "\"" + resultSetMetaData_.getColumnName(column) + "\" = ? ";
updateString += quoteSqlIdentifier( resultSetMetaData_.getColumnName(column)) + " = ? ";
private String buildUpdateString() throws SqlException { int column; int numColumns = 0; // For Derby, eg update t1 set c1=?, c2=? where current of cursorname boolean foundOneUpdatedColumnAlready = false; String updateString = "UPDATE " + getTableName() + " SET "; for (colu...
tableName += "\"" + resultSetMetaData_.sqlxSchema_[baseTableColumn] + "\".";
tableName += quoteSqlIdentifier( resultSetMetaData_.sqlxSchema_[baseTableColumn]) + ".";
private String getTableName() throws SqlException { String tableName = ""; int baseTableColumn = 0; int totalColumns; try { totalColumns = resultSetMetaData_.getColumnCount(); } catch ( SQLException sqle ) { throw new SqlException(sqle); } for (...
tableName += "\"" + resultSetMetaData_.sqlxBasename_[baseTableColumn] + "\"";
tableName += quoteSqlIdentifier( resultSetMetaData_.sqlxBasename_[baseTableColumn]);
private String getTableName() throws SqlException { String tableName = ""; int baseTableColumn = 0; int totalColumns; try { totalColumns = resultSetMetaData_.getColumnCount(); } catch ( SQLException sqle ) { throw new SqlException(sqle); } for (...
costEstimate = optimizer.getFinalCost();
public ResultSetNode modifyAccessPaths() throws StandardException { int origFromListSize = fromList.size(); ResultColumnList leftRCList; ResultColumnList rightRCList; ResultSetNode leftResultSet; ResultSetNode rightResultSet; /* ** Modify the access path for each Optimizable, as necessary ** ** This sho...
TestConnection tc = new TestConnection(); Connection connEmbedded = tc.createEmbeddedConnection(); TestConnectionMethods tcm = new TestConnectionMethods(connEmbedded); tcm.startTestConnectionMethods_Embedded(); Connection connNetwork = tc.createClientConnection(); TestConnectionMethods tcm1 = new TestConnectionMetho...
try { ij.getPropertyArg(args); Connection conn_main = ij.startJBMS(); if ( usingEmbeddedClient() ) { TestConnectionMethods tcm = new TestConnectionMethods( conn_main ); tcm.startTestConnectionMethods_Embedded(); } else { TestConnectionMethods tcm1 = new TestConnectionMethods( conn_main ); tcm1.startTestConnectionMe...
public static void main(String args[]) { TestConnection tc = new TestConnection(); Connection connEmbedded = tc.createEmbeddedConnection(); TestConnectionMethods tcm = new TestConnectionMethods(connEmbedded); tcm.startTestConnectionMethods_Embedded(); Conne...