Subject | Jaybird 1.5 Dynamic SQL errors SQL Code -901 |
---|---|
Author | skanorwalla |
Post date | 2004-08-04T14:17:38Z |
Hello,
A dynamic SQL query with 3 parameters works fine with the
Interclient/Interserver driver but fails with the JayBird v1.5
driver. Dynamic SQL Error SQL code -901 - Feature not supported.
Any reason why this may happen...or is this expected?
Code snippet is as follows:
.........................................
static final String QUERY = "SELECT DATA.symbol, SYMBOLS.name, " +
"DATA.last, DATA.open, DATA.change, DATA.changeproc, " +
"DATA.volume FROM DATA, SYMBOLS " +
"WHERE DATA.symbol = SYMBOLS.symbol AND " +
"EXTRACT(MONTH FROM DATA.date1)=? AND EXTRACT(DAY FROM DATA.date1)
=?" +
" AND EXTRACT(YEAR FROM DATA.date1)=?";
Class.forName("org.firebirdsql.jdbc.FBDriver");
conn = DriverManager.getConnection(
"jdbc:firebirdsql://127.0.0.1:3050/:c:/EMPLOYEE.fdb", "SYSDBA", "
masterkey");
pst = conn.prepareStatement(QUERY);
pst.setInt(1, month);
pst.setInt(2, day);
pst.setInt(3, year);
ResultSet results = pst.executeQuery();
while (results.next()) {
String symbol = results.getString(1);
String name = results.getString(2);
double last = results.getDouble(3);
double open = results.getDouble(4);
double change = results.getDouble(5);
double changePr = results.getDouble(6);
long volume = results.getLong(7);
m_vector.addElement(new StockData(symbol, name, last,
open, change, changePr, volume));
}
..........................................
The operating system is Win XP Pro, database is Firebird v1.5.
Am I missing something?
Thanks,
Shoeb
A dynamic SQL query with 3 parameters works fine with the
Interclient/Interserver driver but fails with the JayBird v1.5
driver. Dynamic SQL Error SQL code -901 - Feature not supported.
Any reason why this may happen...or is this expected?
Code snippet is as follows:
.........................................
static final String QUERY = "SELECT DATA.symbol, SYMBOLS.name, " +
"DATA.last, DATA.open, DATA.change, DATA.changeproc, " +
"DATA.volume FROM DATA, SYMBOLS " +
"WHERE DATA.symbol = SYMBOLS.symbol AND " +
"EXTRACT(MONTH FROM DATA.date1)=? AND EXTRACT(DAY FROM DATA.date1)
=?" +
" AND EXTRACT(YEAR FROM DATA.date1)=?";
Class.forName("org.firebirdsql.jdbc.FBDriver");
conn = DriverManager.getConnection(
"jdbc:firebirdsql://127.0.0.1:3050/:c:/EMPLOYEE.fdb", "SYSDBA", "
masterkey");
pst = conn.prepareStatement(QUERY);
pst.setInt(1, month);
pst.setInt(2, day);
pst.setInt(3, year);
ResultSet results = pst.executeQuery();
while (results.next()) {
String symbol = results.getString(1);
String name = results.getString(2);
double last = results.getDouble(3);
double open = results.getDouble(4);
double change = results.getDouble(5);
double changePr = results.getDouble(6);
long volume = results.getLong(7);
m_vector.addElement(new StockData(symbol, name, last,
open, change, changePr, volume));
}
..........................................
The operating system is Win XP Pro, database is Firebird v1.5.
Am I missing something?
Thanks,
Shoeb