Jump to content
  • 0

Question

Posted (edited)

Hello removed c3p0 from my acis and having problems

 

mQSjcS9.png

 

I'm using these calls

 

package net.sf.l2j;

import java.sql.Connection;
import java.util.logging.Logger;

import com.zaxxer.hikari.HikariDataSource;

public class L2DatabaseFactory
{
	private static final Logger LOGGER = Logger.getLogger(L2DatabaseFactory.class.getName());
	
	private static final HikariDataSource _hds = new HikariDataSource();
	
	public static void init()
	{
		_hds.setDriverClassName("com.mysql.cj.jdbc.Driver");
		_hds.setJdbcUrl(Config.DATABASE_URL);
		_hds.setUsername(Config.DATABASE_LOGIN);
		_hds.setPassword(Config.DATABASE_PASSWORD);
		_hds.setMaximumPoolSize(Config.DATABASE_MAX_CONNECTIONS);
		_hds.setConnectionTimeout(600000);
		_hds.setIdleTimeout(1200000);
		_hds.setMaxLifetime(1200000);
		
		// Test if connection is valid.
		try
		{
			_hds.getConnection().close();
			LOGGER.info("Database: Initialized.");
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
	
	public static Connection getConnection()
	{
		Connection con = null;
		while (con == null)
		{
			try
			{
				con = _hds.getConnection();
			}
			catch (Exception e)
			{
				LOGGER.severe("DatabaseFactory: Cound not get a connection. " + e);
			}
		}
		return con;
	}
	
	public static void shutdown()
	{
		try
		{
			_hds.close();
		}
		catch (Exception e)
		{
			LOGGER.severe("DatabaseFactory: There was a problem closing the data source. " + e);
		}
	}
}


        

Edited by Williams

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • lock , no more copies will be on sale.. 
    • L2servers.eu              
    • its L2Etina dont fall for this guys corrupted scam server
    • [CENTER][B][SIZE=6]🔥 Developer Updates[/SIZE][/B][/CENTER] [CENTER][I]Current list of implemented systems, improvements, and new features[/I][/CENTER] [HR][/HR] [B][SIZE=5]✅ Current Updates[/SIZE][/B] [LIST] [*]Rework of [B]Commission Trade / Auction House[/B] [*]Update: [B]Class System & Subclass Manager[/B] [*]Update: [B]Community Board (.menu) + Settings[/B] [*][B]Donate Hero[/B] (NPC + Alt+B) [/LIST] [HR][/HR] [B][SIZE=5]⚙️ Implemented Systems[/SIZE][/B] [LIST] [*][B]Custom Potion Settings[/B] [*][B]Buff and Debuff Duration Configuration[/B] [*][B]Player Cabinet[/B] [*][B]Epic Boss Status[/B] [*][B]Server Statistics[/B] [*][B]Gatekeeper System[/B] [*][B]Merchant System[/B] [*][B]Donate Manager[/B] [*][B]NPC + Community Buffer[/B] [*][B]Auto Potion System (.acp)[/B] [*][B]Player Cabinet[/B] (Community Board) [*][B]Configuration Translation[/B] [/LIST] [HR][/HR] [CENTER][B]📌 Follow this topic — the update list will continue to grow.[/B][/CENTER]  
    • [CENTER][B][SIZE=6]🔥 Developer Updates[/SIZE][/B][/CENTER] [CENTER][I]Current list of implemented systems, improvements, and new features[/I][/CENTER] [HR][/HR] [B][SIZE=5]✅ Current Updates[/SIZE][/B] [LIST] [*]Rework of [B]Commission Trade / Auction House[/B] [*]Update: [B]Class System & Subclass Manager[/B] [*]Update: [B]Community Board (.menu) + Settings[/B] [*][B]Donate Hero[/B] (NPC + Alt+B) [/LIST] [HR][/HR] [B][SIZE=5]⚙️ Implemented Systems[/SIZE][/B] [LIST] [*][B]Custom Potion Settings[/B] [*][B]Buff and Debuff Duration Configuration[/B] [*][B]Player Cabinet[/B] [*][B]Epic Boss Status[/B] [*][B]Server Statistics[/B] [*][B]Gatekeeper System[/B] [*][B]Merchant System[/B] [*][B]Donate Manager[/B] [*][B]NPC + Community Buffer[/B] [*][B]Auto Potion System (.acp)[/B] [*][B]Player Cabinet[/B] (Community Board) [*][B]Configuration Translation[/B] [/LIST] [HR][/HR] [CENTER][B]📌 Follow this topic — the update list will continue to grow.[/B][/CENTER]
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..