0% found this document useful (0 votes)
34 views1 page

@page: Import

The document provides steps to create an ODBC data source on a server to connect to an Access database and display data from a table. It involves adding an Access driver, giving the data source a name, restarting the server, and using JSP code to connect via JDBC ODBC to the data source and display records from a table.

Uploaded by

Jagan Nathan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

@page: Import

The document provides steps to create an ODBC data source on a server to connect to an Access database and display data from a table. It involves adding an Access driver, giving the data source a name, restarting the server, and using JSP code to connect via JDBC ODBC to the data source and display records from a table.

Uploaded by

Jagan Nathan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Follow these steps: 1)Go to the start<<Control Panel<<Administrative Tools<< data sources.

2)Click Add button and select the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver, click finish button. 4)Then give Data Source Name and click ok button. 5)Your DSN will get created. 6) Restart your server and run your jsp code. Here is your required code: <%@page import="java.sql.*"%> <table border=1> <tr><th>Name</th><th>Address</th></tr> <% try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:student"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from data"); while(rs.next()){ %> <tr><td><%=rs.getString("name")%></td><td><%=rs.getString("address")%></t d></tr> <% } rs.close(); st.close(); con.close(); } catch(Exception e){} %> </table>

You might also like