import java.sql.*; class Program2 { 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 { PreparedStatement pstmt; Employee(Connection con) throws SQLException { pstmt = con.prepareStatement("insert into STAFF values (?,?,?)"); } void close() throws SQLException { pstmt.close(); } void insert(int id,String prename,String surname) throws SQLException { pstmt.setInt(1,id); pstmt.setString(2,prename); pstmt.setString(3,surname); pstmt.executeUpdate(); } } }