removed lib files, updated to intellij from netbeans, changed to kotlin coroutines
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package DataLayer;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.dbcp2.BasicDataSource;
|
||||
import DataLayer.settings;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author install1
|
||||
*/
|
||||
public class DBCPDataSourceAutismo {
|
||||
private static BasicDataSource ds = new BasicDataSource();
|
||||
static {
|
||||
try {
|
||||
ds.setDriver(new com.mysql.cj.jdbc.Driver());
|
||||
ds.setUrl(settings.autismo_url);
|
||||
ds.setUsername(settings.autismo_username);
|
||||
ds.setPassword(settings.autismo_password);
|
||||
ds.setMaxTotal(-1);
|
||||
ds.setMinIdle(5);
|
||||
ds.setMaxIdle(-1);
|
||||
ds.setMaxOpenPreparedStatements(100);
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(DBCPDataSourceAutismo.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static Connection getConnection() throws SQLException {
|
||||
return ds.getConnection();
|
||||
}
|
||||
|
||||
private DBCPDataSourceAutismo() {
|
||||
}
|
||||
}
|
||||
@@ -88,22 +88,6 @@ public class DataMapper {
|
||||
}
|
||||
}
|
||||
|
||||
public static ConcurrentMap<Integer, String> getHLstatsMessages() {
|
||||
ConcurrentMap<Integer, String> hlStatsMessages = new MapMaker().concurrencyLevel(2).makeMap();
|
||||
try (Connection l_cCon = DBCPDataSourceHLstats.getConnection()) {
|
||||
String l_sSQL = "SELECT message FROM `hlstats_Events_Chat`";
|
||||
try (PreparedStatement l_pStatement = l_cCon.prepareStatement(l_sSQL)) {
|
||||
try (ResultSet l_rsSearch = l_pStatement.executeQuery()) {
|
||||
while (l_rsSearch.next()) {
|
||||
hlStatsMessages.put(hlStatsMessages.size() + 1, l_rsSearch.getString(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
Logger.getLogger(DataMapper.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return hlStatsMessages;
|
||||
}
|
||||
|
||||
public static void CloseConnections(PreparedStatement ps, ResultSet rs, Connection con) {
|
||||
if (rs != null) {
|
||||
|
||||
Reference in New Issue
Block a user