public class Withoutdsn { public static void main(String[] args) { try { String database="dsn.accdb";//Here database exists in the current directory String url="jdbc:odbc:Driver={Microsoft Access Driver(*.mdb,*.accdb)};DBQ=" + database + ";DriverID=22;READONLY=false"; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection c=DriverManager.getConnection(url,"",""); Statement st=c.createStatement(); ResultSet rs=st.executeQuery("insert into login values('Anoop','Delhi')"); } catch(Exception e) { System.out.println(e); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)