Here you can find the source of getNewPreparedStatement(String format)
public static PreparedStatement getNewPreparedStatement(String format)
//package com.java2s; //License from project: Open Source License import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { private static final boolean testing = false; static Connection connection = getNewConnection(); public static PreparedStatement getNewPreparedStatement(String format) { try {/*from w w w . j ava2 s . com*/ if (connection == null) connection = getNewConnection(); PreparedStatement s = connection.prepareStatement(format); return s; } catch (SQLException e) { } return null; } private static Connection getNewConnection() { Connection connect; try { Class.forName("com.mysql.jdbc.Driver"); if (testing) connect = DriverManager .getConnection("jdbc:mysql://passwordchanger/test?user=dbUser&password=dbusr"); else connect = DriverManager .getConnection("jdbc:mysql://passwordchanger/production?user=dbUser&password=dbusr"); return connect; } catch (SQLException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } }