#Problems on Database-Communication (HirakiCP)
1 messages · Page 1 of 1 (latest)
if(Chat != null) {
a = "INSERT INTO `" + table_playerinformation + "` (`UUID`, `current_chat`) values ('" + uuid + "', '" + Chat + "') ON DUPLICATE KEY UPDATE `current_chat` = '" + Chat + "'";
} else {
a = "INSERT INTO `" + table_playerinformation + "` (`UUID`, `current_chat`) values ('" + uuid + "', " + null + ") ON DUPLICATE KEY UPDATE `current_chat` = " + null;
}
Connection c = null;
PreparedStatement pst = null;
ResultSet rs = null;
try {
c = getConn();
pst = c.prepareStatement(a);
pst.executeUpdate();
} catch (SQLException throwables) {
throwables.printStackTrace();
} finally {
cleanup(c, pst, rs);
}
The Connection pool is online but nothing gets set or anything
try with some dummy data if that will trigger
Well.. I had some old database connections, without any Pooling or something, just plain connections which I opened on any needed situation.
That was rather dump cause the connections keep remaining on the sql server in the status "sleep".
So I needed a better solution -> Connection Pooling -> HirakiCP
The Selections are working just fine, but this type of SQL isnt working at all - nothing is happening.
Is there any problem with the PreparedStatement#executeUpdate on an SQL with Type of INSERT INTO ... ON DUBLICATE .. UPDATE..
Do I have to treat them differently or should this work just fine?
Also tried regularly #execute() but same result
Already tried:
- manually writing SQL on phpmyadmin
and some Debugger and also Debug-MSGs.
It triggers, but nothing changes in the Database.
If information is needed, I'll try to give some (censored obv.)
hmm
Some extras:
The Connection Pool is actually starting and there are obv. no errors on startup
[*-*:*-*:*-* INFO]: [com.zaxxer.hikari.HikariDataSource] HikariPool-6 - Start completed.```
i dont know