Hi
When I tried to use PreparedStatement object I get exception that tells me "SQLException: Driver does not support this function".
Im using Java 1.4.1
Jdbc:odbc bridge
Access
and how can i know my JDBC Driver version?
public void updateMoviesTable(){
try {
con = DriverManager.getConnection(url,
"myLogin", "myPassword");
String updateString = "UPDATE MOVIES " +
"SET RENTS = ? " +
"WHERE TITLE = ? ";
PreparedStatement updateRents = con.prepareStatement(updateString);
updateRents.setInt(1,45);
updateRents.setString(2,"BirdOn a Wire");
updateRents.executeUpdate();
ResultSet rs = updateRents.executeQuery("select TITLE,RENTS from MOVIES where TITLE='Bird On a Wire'");
while(rs.next()){
String title = rs.getString("TITLE");
int rents = rs.getInt("RENTS");
System.out.println("the title "+ title +" was updated wit "+ rents +" times");
}
}
catch (SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
Thanks
D