Tom Coupland wrote:
> Hi all,
>
> Have been using prepared statements in my proj for
> a while and have enjoyed quite abit of success
> with them, but today i decided to changed the
> order of things abit and now they won't work!
> Heres my code snippet
>
>
> public ResultSet executeStatement(String[] args)
> throws SQLException{
> synchronized(myStatement){
> try{
> for(int i=0;i<args.length;i++){
> log.info("Setting statement var "+(i+1)+" to
> "+args);
> myStatement.setString(i+1, args);
> }
> return myStatement.executeQuery();
>
>
> When it runs i now get this
>
>
> java.lang.NullPointerException at
> com.mysql.jdbc.ServerPreparedStatement.getBinding(
> ServerPreparedStatement.java:733) at
> com.mysql.jdbc.ServerPreparedStatement.setString(S
> erverPreparedStatement.java:1738) at
> org.jboss.resource.adapter.jdbc.WrappedPreparedSta
> tement.setString(WrappedPreparedStatement.java:406
> ) at
> meta.database.PersistentDatagram.executeStatement(
> PersistentDatagram.java:101)
>
>
> Can anyone shed some light on this for me? Would
> really appreciate it!
>
> Cheers
>
> Tom
Tom,
What version of the driver are you using? How did you change the order of things (i.e. what were you doing before that was different).
-Mark
Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html