March 30, 2010 at 11:37 AM
This code works here. Have you configure Access Database to your system? IF not, then do the following:
Go to control panel > administrative tools > ODBC> select the driver for MSACCESS .mdb to give the dsn name and description then go to select button and browse your database for msaccess.Then click ok.
In the following code 'access' is our data source name.Here you have to specify your own data source name.'data' is our MS access Database table.
Connection con = DriverManager.getConnection("jdbc:odbc:access");
String sql = "Select * from data";