Package biblioteca.admin.utilidades

Source Code of biblioteca.admin.utilidades.ConDb

package biblioteca.admin.utilidades;

/*
* 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.
*/
/**
*
* @author ernaes.trujillo
*/


import javax.sql.DataSource;
import org.postgresql.ds.PGPoolingDataSource;

public class ConDb {
    private String userDb;//Usuario de la base de datos;
    private String passDb;//Contraseña de la base de datos;
    private String serverDb;//IP o Nombre del servidor de la base de datos;
    private int portDB;//Puerto de acceso a la base de datos;
    private String dataDb;//Nombre de la base de datos;

    public ConDb() {
        this.userDb = "postgres";
        this.passDb = "familia13";
        this.serverDb = "localhost";
        this.portDB = 5432;
        this.dataDb = "biblioteca";
    }
   
   
    public DataSource getSource(){
        PGPoolingDataSource source = new PGPoolingDataSource();
        source.setDatabaseName(this.dataDb);
        source.setServerName(this.serverDb);
        source.setPortNumber(this.portDB);
        source.setUser(this.userDb);
        source.setPassword(this.passDb);
        source.setMaxConnections(5);      
        return source;
    }

    public String getUserDb() {
        return userDb;
    }

    public void setUserDb(String userDb) {
        this.userDb = userDb;
    }

    public String getPassDb() {
        return passDb;
    }

    public void setPassDb(String passDb) {
        this.passDb = passDb;
    }

    public String getServerDb() {
        return serverDb;
    }

    public void setServerDb(String serverDb) {
        this.serverDb = serverDb;
    }

    public int getPortDB() {
        return portDB;
    }

    public void setPortDB(int portDB) {
        this.portDB = portDB;
    }

    public String getDataDb() {
        return dataDb;
    }

    public void setDataDb(String dataDb) {
        this.dataDb = dataDb;
    }

   
   
   
   
}
TOP

Related Classes of biblioteca.admin.utilidades.ConDb

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.