Subject Re: [Firebird-Java] interclient getParameterMetaData AbstractMethodError
Author rbarlow@raymanoz.com
For anyone interested, I have solved it with the following code:

import interbase.interclient.PreparedStatement;
import interbase.interclient.ParameterMetaData;

import java.sql.SQLException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Types;


public class test {
public static void main(String[] args)
throws ClassNotFoundException, SQLException {
String driver = "interbase.interclient.Driver";
String url = "jdbc:interbase://localhost/C:\\pathTo\\TEST.GDB";
String username = "sysdba";
String password = "masterkey";

Class.forName(driver);
Connection con =
DriverManager.getConnection(url, username, password);
String insert = "INSERT INTO A(B) VALUES (?);";
PreparedStatement ps = (PreparedStatement)con.prepareStatement(insert);
ParameterMetaData pmd = ps.getParameterMetaData();
}
}

Basically, the key was to cast the PreparedStatement to the interbase.interclient version of PreparedStatement.

Cheers,
Raymond


rbarlow@... said:

> Alrighty guys and gals, see if you can solve this one! (Or direct me to the CORRECT forum :)
>
> I've trying to call PreparedStatement.getParameterMetaData, but am having no success. Check it out (I've reproduced in a small app):
>
> TABLE:
> create table a(b varchar(10));
>
> JAVA CODE:
> import java.sql.*;
> import java.lang.*;
>
> public class test {
> public static void main(String[] args)
> throws ClassNotFoundException, SQLException {
> String driver = "interbase.interclient.Driver";
> String url = "jdbc:interbase://localhost/C:\\pathTo\\TEST.GDB";
> String username = "sysdba";
> String password = "masterkey";
>
> Class.forName(driver);
> Connection con =
> DriverManager.getConnection(url, username, password);
> String insert = "INSERT INTO A(B) VALUES (?);";
> PreparedStatement ps = con.prepareStatement(insert);
> // !!!!! STACKS IT ON THIS LINE:
> ParameterMetaData pmd = ps.getParameterMetaData();
> }
> }
>
> ERROR MESSAGE:
> $ java -cp ".;./interclient.jar" test
> Exception in thread "main" java.lang.AbstractMethodError: interbase.interclient.PreparedStatement.getParameterMetaData()Ljava/sql/ParameterMetaData;
> at test.main(test.java:17)
>
> So, what's all this about then? Apparently, I shouldn't get AbstractMethodError's (according to javadoc API).
>
> Help appreciated!
>
> --
> Regards,
> Raymond Barlow
>
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>



--
Regards,
Raymond Barlow
----------------
Hm: +44 161 224 9884
Mb: +44 776 618 3555