Advertisement
JVFabia

Untitled

Aug 3rd, 2020
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package org.forge;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. public class ConnectionManager {
  8.     private static Connection connection = null;
  9.     private static String url = "jdbc:sqlserver://sonar.netbyteoss.com:1433;databaseName=master; user=sa; password=myPassw0rd";
  10.     public static Connection obtenerConexion() throws SQLException {
  11.         if(connection==null)
  12.             connection = DriverManager.getConnection(url);
  13.         return connection;
  14.     }
  15.  
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement