public class Query{
String url,classname;
Connection conn;
public Query() throws ClassNotFoundException,SQLException{
//Specify the database path to connect
String soFTPath=(new File("")).getAbosultePath();
//String softPath="D:\\myProject";
String dbPath=softPath+"\\dbpath\\dbFile.mdb";
url="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="+dbPath;
classname="sun.jdbc.odbc.JdbcOdbcDriver";
Class.forName(classname);
conn=DriverManager.getConnection(url,"newWord","newword");
}