shennanigan83
Programmer
hello there! i'd just like to ask if anyone can tell me the syntax for connecting JSP to MS Access with Tomcat 4 as the web server. I've tried the syntax:
<%
Class.forName("com.sun.jdbc.odbc.Driver".newInstance();
java.sql.Connection con = java.sql.DriverManager.getConnection("jdbcdbc:dane"
java.sql.Statement statement = con.createStatement();
String results = "Select * from table_dane";
java.sql.ResultSet rows = statement.executeQuery(results);
While(rows.next()) {
String Uname = rows.getString("username"
String Pwd = rows.getString("password" %>
<TR> <TD><%= Uname %></TD>
<TD><%= Pwd %></TD>
</TR>
<% } %>
but i am encountering this error that says a missing ';' is expected in While(rows.next()) {
when i put a semi-colon there, tomcat can't find the java.sql.* class. if i try jdbc.sql.* it also doesn't work.
Can anyone please help me? thank you so much in advance!!!
<%
Class.forName("com.sun.jdbc.odbc.Driver".newInstance();
java.sql.Connection con = java.sql.DriverManager.getConnection("jdbcdbc:dane"
java.sql.Statement statement = con.createStatement();
String results = "Select * from table_dane";
java.sql.ResultSet rows = statement.executeQuery(results);
While(rows.next()) {
String Uname = rows.getString("username"
String Pwd = rows.getString("password" %>
<TR> <TD><%= Uname %></TD>
<TD><%= Pwd %></TD>
</TR>
<% } %>
but i am encountering this error that says a missing ';' is expected in While(rows.next()) {
when i put a semi-colon there, tomcat can't find the java.sql.* class. if i try jdbc.sql.* it also doesn't work.
Can anyone please help me? thank you so much in advance!!!