This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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}; |