Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connection connection = null;
- String url = "jdbc:mysql://localhost/testdb";
- String user = "root";
- String password = "";
- Class.forName("com.mysql.jdbc.Driver");
- connection = DriverManager.getConnection(url,user, password);
- Statement stmt = connection.createStatement();
- // progressBar.setValue(50);
- StringTokenizer st = new StringTokenizer(mobid.getText(), ",");
- while (st.hasMoreTokens()) {
- String idmob = st.nextToken();
- stmt.execute("INSERT INTO droplist VALUES('" + idmob + "', '" + iditem.getText() + "', '" + min.getText() + "', '" + max.getText() + "', '" + category.getText() + " ', '" + chance.getText() + "0000');");
- }
- if (connection != null)
- {
- connection.close();
- }
- if(stmt != null)
- {
- stmt.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement