#Problems on Database-Communication (HirakiCP)

1 messages · Page 1 of 1 (latest)

pine vessel
#
        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

final lotus
#

try with some dummy data if that will trigger

pine vessel
#

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

pine vessel
final lotus
#

hmm

pine vessel
#

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.```
final lotus
#

i dont know