package siprp.planoactuacao.db;

import siprp.planoactuacao.SingletonConstants;

import com.evolute.utils.Singleton;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.JDBCManager;
import com.evolute.utils.db.keyretrievers.PostgresqlAutoKeyRetriever;
import com.evolute.utils.sql.Insert;
import com.evolute.utils.strings.UnicodeChecker;

public class PlanoActuacaoDBInit
{
	public static void initDB()
		throws Exception
	{
		DBManager webManager = new JDBCManager( DBConstants.WEB_URL,
				DBConstants.WEB_USER, DBConstants.WEB_PASSWORD , 10, 8, 8, 
				DBConstants.INIT );
		DBManager localManager = new JDBCManager( DBConstants.LOCAL_URL,
				DBConstants.LOCAL_USER, DBConstants.LOCAL_PASSWORD , 10, 8, 8, 
				DBConstants.INIT );
		Singleton.setInstance( SingletonConstants.WEB_DBMANAGER, webManager );
		Singleton.setInstance( SingletonConstants.LOCAL_DBMANAGER, localManager );
		Insert.setDefaultKeyRetriever( PostgresqlAutoKeyRetriever.RETRIEVER );
		UnicodeChecker.setUseDoubleSlash( true );
	}
}
