moaz.amin.37 -12 Junior Poster

i have a problem in JDBC every thing is ok it shows this message
java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver i already create DSN but but it stil show this error i do not know what i do
My jdk is 64 bit and i create DSN of odbc 32 bit is any problem is here that jdk is 64 bit and odbc is 32 bit
my code is here

import java.sql.*;
class FirstJDBC{

    public static void main(String s[]){

        try{

            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String url="jdbc:odbc:personDSN";
            Connection con=DriverManager.getConnection(url);
            Statement st=con.createStatement();
            String q="SELECT * FROM Person";
            ResultSet rs=st.executeQuery(q);
            while(rs.next()){

                String name=rs.getString("name");
                String add=rs.getString("address");
                String pNum=rs.getString("phoneNum");
            }
            con.close();
        }catch(Exception e){

            System.out.println(e);
        }

    } 
}

please help me

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.