Sun's JDBC Tutorial. Need a Little Help
im learning about JBDC using suns tutorial but ive run into a problem. on this page here http://java.sun.com/docs/books/tutorial/jdbc/basics/retrieving.html about 1/7th of the way through they give u some code. but when i used it in my IDE (netbeans 5.5) i get 2 errors:
try{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection con = DriverManager.getConnection("jdbc.derby.COFFEES");
Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet srs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM COFFEES");
}catch(ClassNotFoundException ex){
ex.printStackTrace();
}catch(SQLException ex){
ex.printStackTrace();
}
D:\Java\Java Phonebook\src\JavaPhonebook\JDBCTutorial.java:32: incompatible types
found: java.sql.Statement
required: java.beans.Statement
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
D:\Java\Java Phonebook\src\JavaPhonebook\JDBCTutorial.java:33: cannot find symbol
symbol : method executeQuery(java.lang.String)
location:class java.beans.Statement
srs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM COFFEES");
2 errors
Message was edited by:
Alex1989

