createStatement() does not work on passing parameters
I use following code to create statement,
I am using Microsoft Access DataBase
1:st= dbConnection.createStatement();
2:st= dbConnection.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE );
-
rsAuthors = st.executeQuery
("SELECTlastname,firstname,city,country FROM authors ");
line 1: using ,complies and run reterning resultset forwardonly
line 2: using ,compiles but on run message displayed on command
prompt
"Optional features of Microsoft Access
drivers are not implemented "
why...............
Actually, what I wanted to say is that you need a driver that is compliant with JDBC 2.0 API. This is because scrollable and updatable resultsets are introduced in this API.
About the driver "types": all jdbc drivers fall into certain categories (types). For a short description about each type, take a look at http://java.sun.com/products/jdbc/driverdesc.html
So, what you basically need to do is go to the link mentionned in my previous posting, select "JDBC API 2.0" and "MS Access" or "ODBC", and search for a compliant driver. The most of them offer a trial version.
For someone, who's very new to Java, I would suggest:
1. Simply use a default Statement. You can do every SQl command with it.
For learning it's enough, what you have:
Access, ODBC, standard JDBC features.
If you go forward and come near big scale productive environment, then t's time for:
"real" DBMS e.g. SQLServer, Oracle, maybe Interbase 6 (=free), Type 4 driver, advanced JDBC features.
2. Don't forget leukbr's 10 Duke Dollars :-)