Prepared statement exception
hello guys,
My code is:
publicstaticvoid addPrepOrder(String src_db,
int orderId,
String supplierName,
String orderDate)
{
try{
Connection con= DriverManager.getConnection(src_db);
Statement stmt = con.createStatement();
String SQL ="insert into tblOrder(supplierName,orderDate)" +
" values(?,?)";
PreparedStatement pstmt = con.prepareStatement(SQL);
pstmt.setString(1, supplierName);
pstmt.setString(2, orderDate);
pstmt.executeUpdate(SQL);
stmt.close();
con.close();
}catch (SQLException e){
e.printStackTrace();
}
}
and it throws the following exception:
java.sql.SQLException: Driver does not support this function
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(Unknown Source)
at AcomDBPack.Utilities.addPrepOrder(Utilities.java:83)
at AcomDBPack.Utilities.runSimulation(Utilities.java:125)
at AcomDBPack.acomMain.main(acomMain.java:62)
Any idea whats wrong? Its the first time i try to use prepared statements. Is there something wrong with that?
BR
Charalambos

