Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package Modelo;
- import java.sql.*;
- public class Conexion {
- public Conexion() {
- }
- public Connection getConexion(){
- Connection con=null;
- try{
- /* Carga|Registra el driver JDBC */
- Class.forName("com.mysql.jdbc.Driver").newInstance();
- /* Obtener la conexion */
- con = DriverManager.getConnection("jdbc:mysql://localhost:3306/bd_prueba","root","");
- }catch(SQLException ex){
- }catch(Exception e){
- }
- return con;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement