public static void insertDB(){
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:driver={Microsoft Paradox Driver (*.db )};"
+ "DriverID=538;Fil=Paradox 5.x;DefaultDir=E:\\standard;"
+ "Dbq=E:\\standard;CollatingSequence=ASCII";
try {
Class.forName(driver);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Connection conn = null;
Statement stmt = null;
try {
conn = DriverManager.getConnection(url);
stmt = conn.createStatement();
stmt.executeUpdate("insert into standard VALUES(1,2)");
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
} |
|