db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject are prepareCall and prepareStatement interchangeable when calling derby system procedures?
Date Sat, 26 May 2007 07:25:47 GMT
I see both use of prepareCall and prepareStatement in the tests.
Are both right?  If not is it surprising that the tests pass?


I see code in ImportExportBaseTest like the following:
protected void doExportTable(String schemaName,
                              String tableName,
                              String fileName,
                              String colDel ,
                              String charDel,
                              String codeset) throws SQLException
{
     String expsql =
         "call SYSCS_UTIL.SYSCS_EXPORT_TABLE (? , ? , ? , ?, ? , ?)";
     PreparedStatement ps = prepareStatement(expsql);
     ps.setString(1, schemaName);
     ps.setString(2, tableName);
     ps.setString(3, fileName);
     ps.setString(4, colDel);
     ps.setString(5, charDel);
     ps.setString(6, codeset);
     ps.execute();
     ps.close();
}


And I see code in ImportExportProcedureTest like the following:
cSt = prepareCall(
     "call SYSCS_UTIL.SYSCS_EXPORT_TABLE (null, 'EX_EMP' "
     + ", 'extinout/emp.dat' , null, null, null) ");


Mime
View raw message