Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package totalpos;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- import java.sql.Statement;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author shidalgo
- */
- public class ConectionDrivers {
- private static Connection connections[];
- private static Statement statements[];
- protected static boolean initialize(){
- connections = new Connection[Constants.numberConnection];
- for (int i = 0; i < connections.length; i++) {
- try {
- String s = "jdbc:mysql://" + Constants.dbHost + "/" +
- Constants.dbName + "?user=" + Constants.dbUser + "&password=" + Constants.dbPassword;
- System.out.println(s);
- connections[i] = DriverManager.getConnection(s);
- statements[i] = connections[i].createStatement();
- } catch (SQLException ex) {
- Logger.getLogger(ConectionDrivers.class.getName()).log(Level.SEVERE, null, ex);
- return false;
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement