import java.sql.*; String url = "jdbc:oracle:thin:@localhost:1521:XE"; String username = "username"; String password = "password"; Connection connection = DriverManager.getConnection(url, username, password); Statement statement = connection.createStatement(); statement.addBatch("INSERT INTO employees (id, name) VALUES (1, 'John')"); statement.addBatch("INSERT INTO employees (id, name) VALUES (2, 'Jane')"); statement.addBatch("INSERT INTO employees (id, name) VALUES (3, 'David')"); int[] result = statement.executeBatch(); statement.close(); connection.close();


上一篇:
下一篇:
切换中文