Re: jdbc driver problems

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: Wed, 31 Jan 2001 17:57:53 GMT
Message-ID: <3A785339.EC81E385_at_rationalconcepts.com>


Hi,
  double check your code:
  For each placeholder you specified in the PreparedStatement, you must bind a value to it before executing...

  String myupdate = "update table foo set col1 = ?, col2 = ?, col3 = ? where something = ?";

  (Note 4 placeholders: col1, col2, col3 are varchar2's and something is a number)

  PreparedStatement foo = con.prepareStatement(myupdate);

  foo.setString(1, 'This');
  foo.setString(2, 'is ');
  foo.setString(3, 'a test');
  foo.setInt(4, 5);

  foo.executeUpdate();

(woa, just noticed you cross-posted to everybody and their dog...please refrain from this type of behavior...a good bet to get answers from is the server group, although you probably could have gotten this answer from a java users group...)

hth,
cindy

Emanuele de Rinaldis wrote:

> Hi all,
>
> I've a problem in the upgrading from oracle 8.0.5 to oracle 8.1.6:
>
> when I use the jdbc drivers for oracle 8.0.5 I don't manage to get the
> connection to oracle 8.1.6 , but when I use the drivers for oracle 8.1.6
> I get errors from preparedStatement.executeUpdate() method calls:
>
> ORA-01008: not all variables bound
>
> I tried either with jdk 1.2 and jdk 1.3 but the problem still persist.
>
> Does anybody know how to solve the problem ? Any help will be really
> apreciated...
>
> Thanks,
>
> Manuel de Rinaldis
Received on Wed Jan 31 2001 - 18:57:53 CET

Original text of this message