My first try at connecting db... I have set up my odbc connection in the data source admin,and I have given my data source a name. I think my problem is in my jsp <% Class.forName("sun.jdbc.odbc.Driver"); java.sql.Connection connection = java.sql.DriverManager.getConnection( "jdbc dbc:c:/tomcat/webapps/examples/jsp/monicaAcerra/ma"); java.sql.Statement statement = connection.createStatement(); java.sql.ResultSet columns = statement.executeQuery( "SELECT * FROM url"); while(columns.next()) { String name = columns.getString("name"); String url = columns.getString("url"); %> <tr> <td><%= name %></td> <td><%= url %></td> </tr> <% } %> TIA Monica
java.sql.Connection connection = java.sql.DriverManager.getConnection( "jdbc dbc:c:/tomcat/webapps/examples/jsp/monicaAcerra/ma) What is this c:/tomcat/webapps/examples/jsp/......? I think you need to provide DSN name after odbc:...... Is it your DSn name or the path? I m sorry I did not get it?
VAIBHAV <BR>SCJP
monica acerra
Greenhorn
Joined: Mar 26, 2001
Posts: 6
posted
0
I fixed type-o and I guess my dns should just look like: java.sql.Connection connection = java.sql.DriverManager.getConnection( "jdbc dbc:ma"); ,,,, my errors are: ERROR 505 javax.servlet.ServletException: Unable to load class sun.jdbc.odbc.Driver ,, java.lang.ClassNotFoundException: Unable to load class sun.jdbc.odbc.Driver TIA, Monica