cleaned up, formatted and made the project runnable after decompilation
This commit is contained in:
43
src/main/java/com/methods/Util.java
Normal file
43
src/main/java/com/methods/Util.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.methods;
|
||||
|
||||
import com.main.Scheduler;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public class Util {
|
||||
static Logger log = Logger.getLogger(Scheduler.class.getName());
|
||||
|
||||
public static Connection getDBConnection() {
|
||||
Connection dbConnection = null;
|
||||
|
||||
try {
|
||||
Class.forName(Scheduler.prop.getProperty("DB_DRIVER"));
|
||||
dbConnection =
|
||||
DriverManager.getConnection(
|
||||
Scheduler.prop.getProperty("DB_URL"),
|
||||
Scheduler.prop.getProperty("DB_USER"),
|
||||
Scheduler.prop.getProperty("DB_PWD"));
|
||||
} catch (Exception e) {
|
||||
log.error(String.valueOf(e.getMessage()) + " in Util class db connection error");
|
||||
}
|
||||
return dbConnection;
|
||||
}
|
||||
|
||||
public static Connection getDBConnectionforAPI() {
|
||||
Connection dbConnection = null;
|
||||
|
||||
try {
|
||||
Class.forName(Scheduler.prop.getProperty("DB_DRIVER"));
|
||||
dbConnection =
|
||||
DriverManager.getConnection(
|
||||
Scheduler.prop.getProperty("DB_URL_API"),
|
||||
Scheduler.prop.getProperty("DB_USER_API"),
|
||||
Scheduler.prop.getProperty("DB_PWD_API"));
|
||||
} catch (Exception e) {
|
||||
log.error(
|
||||
String.valueOf(e.getMessage()) + " in Util class db connection error for API database");
|
||||
}
|
||||
return dbConnection;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user