Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prepared Statement problem

    I'm new to MySQL and am having problems with Prepared Statements in MySQL. Here is what I'm trying to do:


    Connection con = x.getConnection(); /* gets the connection

    PreparedStatement ps = con.prepareStatement(sql); /* set up prepared statement

    x.bindExampleWhere(ps, example); /* sets the preparedstatement's variables

    ResultSet rs=ps.executeQuery();


    The SQL is:
    select * from Vendor
    where (Vendor.agreement_id = ?)

    The BindExample will produce:
    (1,'1001')


    The result set is always empty. When I run the query directly, I get the expected result.

    This code worked when going against an Oracle Database.

    Any advice would be appreciated.

    -Ryan

  • #2
    New to the CF scene
    Join Date
    Oct 2002
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Additional info

    Forgot to add that I'm using Innodb with the latest beta of MySQL.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •