
I am using windows 7 with 32 bit os I installed java 1.6 version I also installed oracle 10g. When I am trying to execute jdbc-odbc programs it simply displays "jdbc drivers not found" plz help me

Java connect to MS Access database
If you want to connect MS Access database with the java code using driver "sun.jdbc.odbc.JdbcOdbcDriver", then 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 compiler and compile your java code.
Example:
import java.sql.*;
class RetrieveData{
public static void main(String[] args){
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()){
System.out.println(rs.getString("name")+" "+rs.getString("address"));
}
}
catch(Exception e){
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.