Subject Re: [Firebird-Java] JayBird: Problems with Prepared Statements
Author David Johnson
The toString() method has not overridden the default Object.toString()
method. You will not be able to see the original statement by this
mechanism. This is also typical of the commercial JDBC drivers that I
have used.

In my experience, PreparedStatement works correctly.

try {
Prepared_statement.clear ();
Prepared_statement.setString(1, 'SomeValue');
Prepared_statement.setString(2, 'OtherValue');
Prepared_statement.execute ();
}
catch (SQLException ex)
{
// exception handling
}



On Tue, 2005-09-06 at 01:09 +0000, pifproject wrote:
> I am using Firebird Database Server v1.5.2 with the JayBird v1.5.5
> JCA/JDBC driver ( more precisely the firebirdsql-full.jar ). I get
> problems with prepared statements, whose parameters I would like to
> set consequently. When I use:
> prepared_statement = connection.prepareStatement(String
> sqlCode);
>
> and try to see what the prepared statement is by:
> Prepared_statement.toString();
>
> I get the following:
> org.firebirdsql.jdbc.FBPreparedStatement@13a317a
>
> instead of a statement like:
> INSERT INTO Table_name (Column_1, Column_2) VALUES (?, ?)
>
> which parameters I can set consequently by:
> Prepared_statement.setString(1, 'SomeValue');
> Prepared_statement.setString(2, 'OtherValue');
>
> Do you know what goes wrong in order for the connection not be able to
> prepare an INSERT statement of the kind shown above and how I can
> solve that problem? Please answer as soon as possible. Many thanks in
> advance for your suggestions.
>
>
>
>
>
>
>
> SPONSORED LINKS
> Basic programming
> language
> Computer programming
> languages
> Programming languages
> Java programming
> language
> The history of computer
> programming language
>
>
> ______________________________________________________________________
> YAHOO! GROUPS LINKS
>
> 1. Visit your group "Firebird-Java" on the web.
>
> 2. To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
> 3. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
> ______________________________________________________________________
>