public static void insertEmployees() { Connection con = getConnection(); String insertString1, insertString2, insertString3, insertString4; insertString1 = "insert into Employees values(6323, 'Hemanth')"; insertString2 = "insert into Employees values(5768, 'Bob')"; insertString3 = "insert into Employees values(1234, 'Shawn')"; insertString4 = "insert into Employees values(5678, 'Michaels')"; try { stmt = con.createStatement(); stmt.executeUpdate(insertString1); stmt.executeUpdate(insertString2); stmt.executeUpdate(insertString3); stmt.executeUpdate(insertString4); stmt.close(); con.close(); } catch(SQLException ex) { System.err.println("SQLException: " + ex.getMessage()); }
2011년 7월 20일 수요일
JDBC Insert Example(JDBC insert 예제)
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기