1 package org.apache.derbyTesting.backupRestore; 2 import java.sql.*; 3 4 7 8 public class Customer 9 { 10 11 public static void addCustomer(int id, String name) 12 throws SQLException 13 { 14 Connection conn = DriverManager.getConnection("jdbc:default:connection"); 15 PreparedStatement ps = conn.prepareStatement( 16 "insert into customer VALUES(?, ?)"); 17 18 ps.setInt(1, id); 19 ps.setString(2, name); 20 ps.executeUpdate(); 21 ps.close(); 22 conn.close(); 23 } 24 } 25 | Popular Tags |