Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package br.com.imobiliaria.model;
- import java.sql.*;
- /**
- *
- * @author alexandre
- */
- public class ModuloConexao {
- public static Connection conector() throws SQLClientInfoException {
- String server = "172.17.0.2", sql;
- String port = "1521"; // Porta TCP padrão do Oracle
- //String database = "imobiliaria";
- // Configuração dos parâmetros de autenticação
- String user = "imobiliaria";
- String passwd = "imob2019";
- try {
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String url = "jdbc:oracle:thin:@" + server + ":" + port + ":" + "xe";
- // Abre-se a conexão com o Banco de Dados
- Connection con = DriverManager.getConnection(url, user, passwd);
- return con;
- } catch (Exception e) {
- e.printStackTrace();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement