Subject Possible bug with Jaybird and StoredProcedure w/Variable call
Author Steven Jardine
Hello all,

I may have found a bug with Jaybird 1.5 RC3. I have an existing
application that executes a stored procedure with a single varchar
variable. The call is "execute procedure get_lo_id 'SJARDINE'" and it
returns a result that is stored in new_load_id. It works in Jaybird
1.0.? but fails in Jaybird 1.5 RC3. I have been doing my testing on
Intel P4/Windows XP/JDK1.4.2 and Intel P4/Debian Linux/JDK1.4.2. I have
included my stack trace with my example code. Please let me know what
you think and if you need additional information. Thanks.

Steve

org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic
SQL Error
SQL error code = -204
Procedure unknown
GET_LO_IDSJARDINE
at
org.firebirdsql.jdbc.AbstractCallableStatement.execute(AbstractCallableStatement.java:162)
at
manualdbadjustment.ManualAdjustment.executeCode(ManualAdjustment.java:107)
at
manualdbadjustment.ManualAdjustment.btnExecute_actionPerformed(ManualAdjustment.java:91)
at
manualdbadjustment.ManualAdjustment$1.actionPerformed(ManualAdjustment.java:77)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
at org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -204
Procedure unknown
GET_LO_IDSJARDINE
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1759)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1712)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_prepare(GDS_Impl.java:1224)
at
org.firebirdsql.jca.FBManagedConnection.prepareSQL(FBManagedConnection.java:746)
at
org.firebirdsql.jdbc.AbstractConnection.prepareSQL(AbstractConnection.java:934)
at
org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1027)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:843)
at
org.firebirdsql.jdbc.AbstractCallableStatement.execute(AbstractCallableStatement.java:149)
at
manualdbadjustment.ManualAdjustment.executeCode(ManualAdjustment.java:107)
at
manualdbadjustment.ManualAdjustment.btnExecute_actionPerformed(ManualAdjustment.java:91)
at
manualdbadjustment.ManualAdjustment$1.actionPerformed(ManualAdjustment.java:77)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


Here is a working example of my problem:
String loadID = "";
try
{
//Gets a connection via FirebirdSQL Connection Pool.
Connection connection = Database.get();
try
{
String SQL = "execute procedure get_lo_id 'SJARDINE'";
CallableStatement statement = connection.prepareCall(SQL);
try
{
statement.execute();
ResultSet result = statement.getResultSet();
try
{
if (result.next()) loadID = result.getString("new_load_id");
}
finally
{
result.close();
}
}
finally
{
statement.close();
}
}
finally
{
connection.close();
}
System.out.println(load);
}
catch (Exception e)
{
e.printStackTrace();
}