25 lines
850 B
Java
25 lines
850 B
Java
package com.example.starter;
|
|
|
|
import io.vertx.core.Vertx;
|
|
import io.vertx.jdbcclient.JDBCConnectOptions;
|
|
import io.vertx.jdbcclient.JDBCPool;
|
|
import io.vertx.ext.auth.jwt.JWTAuth;
|
|
import io.vertx.ext.auth.jwt.JWTAuthOptions;
|
|
import io.vertx.sqlclient.PoolOptions;
|
|
|
|
public class DatabaseService {
|
|
JDBCPool pool;
|
|
|
|
public DatabaseService(Vertx vertx) {
|
|
pool = JDBCPool.pool(vertx,
|
|
new JDBCConnectOptions()
|
|
.setJdbcUrl("jdbc:postgresql://localhost:5432/users?useUnicode=true&characterEncoding=UTF-8") //Url de la bdd
|
|
.setUser("postgres") // Nom d'utilisateur PostgreSQL
|
|
.setPassword("admin"), // Mot de passe PostgreSQL
|
|
new PoolOptions()
|
|
.setName("")
|
|
.setMaxSize(16)
|
|
);
|
|
}
|
|
}
|