Skip to content

Instantly share code, notes, and snippets.

View mehmetbebek's full-sized avatar
🎯
Focusing

Mehmet BEBEK mehmetbebek

🎯
Focusing
View GitHub Profile
@mehmetbebek
mehmetbebek / batch_mysql_insert_via_java.java
Last active August 29, 2015 13:57
Insert Batch Recods(More than One Record At A Time) On Oracle via Java
//If your database is mysql then you can use these codes
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/work_training", "root", "");
Statement st = conn.createStatement();
String query = "insert into SALES values (?,?, ?, ?,?, ? ,?)";
PreparedStatement pStatement = conn.prepareStatement(query);
int[] products = new int[]{100, 200, 300, 400};