can some one please post a tutorial or a link to a tutorial on how to connect to msaccess database pelase :D
Printable View
can some one please post a tutorial or a link to a tutorial on how to connect to msaccess database pelase :D
For example you called your database management.mdb:
Then you can create a new class where you can fully use this connector:Code:import java.sql.*;
import java.sql.DriverManager;
import java.io.*;
public class MSDbConnector {
private Connection conn=null;
public Connection dbConnect() throws SQLException, ClassNotFoundException{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:management";
return conn=DriverManager.getConnection(url,"","");
}
public void closeConnection()throws SQLException{
conn.close();
}
}
Code:import java.sql.*;
import java.util.ArrayList;
import java.util.Properties;
import java.io.*;
public class MSDbFacadeJob {
Statement psth = null;
ResultSet res = null;
MSDbConnector conn = null;
public MSDbFacadeJob() throws Exception {
conn = new MSDbConnector();
psth = conn.dbConnect().createStatement();
}
.....................
your methods
..................
}