Sample JAVA Program For MS ACCESS DATABASE connectivity
Create DATABASE in MS ACCESS then..........................
import java.sql.*;
public class Sample
{
public static void main(String[] args)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Data_Source_name", "username","password" );
Statement s = con.createStatement();
s.executeQuery("SELECT * FROM Table_name");
ResultSet rset=s.getResultSet();
while(rset.next())
{System.out.println(rset.getString("Column_name"));
}
}
catch(ClassNotFoundException exp)
{
System.err.println(exp);
}
catch(SQLException exp)
{System.err.println(exp);
}
}
}
where => "jdbc:odbc:Data_Source_name" represents URL of your database