import java.sql.*; class Program1 { static String url = "jdbc:mimer://localhost/test"; static String uid = "SYSADM"; static String pwd = "SYSADM"; public static void main(String[] Args) { try { Class.forName("com.mimer.jdbc.Driver"); Connection con = DriverManager.getConnection(url,uid,pwd); Employee emp = new Employee(con); emp.insert(4709,"Göran","Persson"); emp.insert(4710,"Ingvar","Carlsson"); emp.insert(4711,"Carl","Bildt"); emp.insert(4712,"Ingvar","Carlsson"); emp.insert(4713,"Olof","Palme"); emp.insert(4714,"Torbjörn","Fälldin"); // emp will be garbage collected in time, but we want to... // ...release server resources as soon as possible. emp.close(); } catch (Exception e) { System.out.println(e.getMessage()); } } static class Employee { Statement stmt; Employee(Connection con) throws SQLException { stmt = con.createStatement(); } void close() throws SQLException { stmt.close(); } // Note. prename and surname must not contain ' or SQL escape characters. void insert(int id,String prename,String surname) throws SQLException { String sql = "insert into STAFF values ("+id+",'"+prename+"','"+surname+"')"; stmt.executeUpdate(sql); } } }