in com.l2jserver.commons.database.pool.IConnectionFactory.java:
Code: Select all
default Connection getConnection()
{
Connection con = null;
while (con == null)
{
try
{
con = getDataSource().getConnection();
}
catch (SQLException e)
{
LOG.warn("{}: Unable to get a connection!", getClass().getSimpleName(), e);
}
}
return con;
}
Code: Select all
default Connection getConnection(boolean login)
{
Connection con = null;
while (con == null)
{
try
{
if (login)
{
System.out.println("Switching Databases.");
HikariDataSource ds = (HikariDataSource) getDataSource();
ds.setJdbcUrl("jdbc:mysql://localhost/l2jlogin?useSSL=false&serverTimezone=UTC");
con = ds.getConnection();
}
else
{
con = getDataSource().getConnection();
}
}
catch (SQLException e)
{
LOG.warn("{}: Unable to get a connection!", getClass().getSimpleName(), e);
}
}
return con;
}
default Connection getConnection()
{
return getConnection(false);
}