rcandersonmn
10-28-2002, 02:52 PM
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
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