1.Latest version of JDBC API? 2.I am working on a GUI based application that involves interaction with database. I had used PreparedStatement for executing queries. I want to sent the date which I am getting as an input from the user to the database. I used the following statement stmt.setDate(4,txtyear.getText()); and I am getting compilation error. My database is Oracle and I had set that particular column which receives input from the above setString() method with Date datatype. Some one please help me.
1. That's not a question. Do you mean "What is the latest version of the JDBC API?". Or "Where is the latest verson of the JDBC API?". 2. Re-read the JavaDocs for the PreparedStatement setDate methods. There isn't one which takes a String.
Vishnu, 1) JDBC 3.0 came out with Java 1.4. I don't recall the version number with Java 1.5. It does have some new JDBC features, so the version number has changed. 2) setDate() takes a Date object as the second parameter. getText() returns a String. You can use the SimpleDateFormat class to turn that String into a Date.