Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void insert(String table, String columns, List<String> values){
- try {
- Statement statement;
- statement = db.getConnection().createStatement();
- String walus = "(";
- for(String key : values){
- walus = walus + "'" + key + "',";
- }
- walus = walus.substring(0, walus.length()-1) + ")";
- statement.executeUpdate("INSERT INTO " + table + " " + columns + " VALUES " + walus);
- statement.close();
- } catch (SQLException e) {
- Core.criticalError(e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement