Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public PreparedStatement getStatement(Connection c) {
- try {
- PreparedStatement prepStmt = c.prepareStatement(this.SQL);
- if (this.values != null) {
- for (int i = 1; i < this.values.length; i++) {
- if (this.values[i] instanceof String) {
- prepStmt.setString(i, this.values[i].toString());
- continue;
- }
- if (this.values[i] instanceof Integer) {
- prepStmt.setInt(i, (Integer) this.values[i]);
- continue;
- }
- this.plugin.sendConsoleMessage(Level.SEVERE, this.plugin
- .getLocalizationManager()
- .getLocalString("BAD_SQL_INPUT"));
- }
- }
- return prepStmt;
- } catch (Exception e) {
- this.plugin.sendConsoleMessage(Level.SEVERE, this.plugin
- .getLocalizationManager()
- .getLocalString("DB_PREP_STMT_ERR"));
- e.printStackTrace();
- }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement