Quelques erreurs de connection à la base de données

This commit is contained in:
Mysaa 2021-05-23 02:32:45 +02:00
parent 3640b97dde
commit 9683cf84cd

View File

@ -211,7 +211,7 @@ public class EcouteurDEvents implements EventListener{
case "DisconnectEvent": case "DisconnectEvent":
DisconnectEvent e4 = (DisconnectEvent)event; DisconnectEvent e4 = (DisconnectEvent)event;
s = db.prepareStatement("INSERT INTO disconnectEvent VALUES (?,?,?,?,?,?,?)"); s = db.prepareStatement("INSERT INTO disconnectEvent VALUES (?,?,?,?,?,?,?)");
s.setBlob(2, new Blob((e4.getClientCloseFrame()==null)?new byte[0]:((e4.getServiceCloseFrame().getPayload())== null?new byte[0]:e4.getServiceCloseFrame().getPayload()),null)); s.setBlob(2, new Blob((e4.getClientCloseFrame()==null)?new byte[0]:((e4.getClientCloseFrame().getPayload())== null?new byte[0]:e4.getClientCloseFrame().getPayload()),null));
s.setString(3, (e4.getCloseCode()==null)?null:e4.getCloseCode().name()); s.setString(3, (e4.getCloseCode()==null)?null:e4.getCloseCode().name());
s.setDate(4, new java.sql.Date(e4.getDisconnectTime().toEpochSecond())); s.setDate(4, new java.sql.Date(e4.getDisconnectTime().toEpochSecond()));
s.setBlob(5, new Blob((e4.getServiceCloseFrame().getPayload()==null)?new byte[0]:e4.getServiceCloseFrame().getPayload(),null)); s.setBlob(5, new Blob((e4.getServiceCloseFrame().getPayload()==null)?new byte[0]:e4.getServiceCloseFrame().getPayload(),null));
@ -919,7 +919,7 @@ public class EcouteurDEvents implements EventListener{
break; break;
case "RoleUpdateColorEvent": case "RoleUpdateColorEvent":
RoleUpdateColorEvent e97 = (RoleUpdateColorEvent)event; RoleUpdateColorEvent e97 = (RoleUpdateColorEvent)event;
s = db.prepareStatement("INSERT INTO RoleUpdateColorEvent VALUES (?,?,?,?,?)"); s = db.prepareStatement("INSERT INTO roleUpdateColorEvent VALUES (?,?,?,?,?)");
s.setLong(2, e97.getGuild().getIdLong()); s.setLong(2, e97.getGuild().getIdLong());
s.setLong(3, e97.getRole().getIdLong()); s.setLong(3, e97.getRole().getIdLong());
s.setInt(4, e97.getOldColorRaw()); s.setInt(4, e97.getOldColorRaw());
@ -927,14 +927,14 @@ public class EcouteurDEvents implements EventListener{
break; break;
case "RoleUpdateHoistedEvent": case "RoleUpdateHoistedEvent":
RoleUpdateHoistedEvent e98 = (RoleUpdateHoistedEvent)event; RoleUpdateHoistedEvent e98 = (RoleUpdateHoistedEvent)event;
s = db.prepareStatement("INSERT INTO RoleUpdateHoistedEvent VALUES (?,?,?,?)"); s = db.prepareStatement("INSERT INTO roleUpdateHoistedEvent VALUES (?,?,?,?)");
s.setLong(2, e98.getGuild().getIdLong()); s.setLong(2, e98.getGuild().getIdLong());
s.setLong(3, e98.getRole().getIdLong()); s.setLong(3, e98.getRole().getIdLong());
s.setBoolean(4, e98.wasHoisted()); s.setBoolean(4, e98.wasHoisted());
break; break;
case "RoleUpdateMentionableEvent": case "RoleUpdateMentionableEvent":
RoleUpdateMentionableEvent e101 = (RoleUpdateMentionableEvent)event; RoleUpdateMentionableEvent e101 = (RoleUpdateMentionableEvent)event;
s = db.prepareStatement("INSERT INTO RoleUpdateMentionableEvent VALUES (?,?,?,?,?)"); s = db.prepareStatement("INSERT INTO roleUpdateMentionableEvent VALUES (?,?,?,?,?)");
s.setLong(2, e101.getGuild().getIdLong()); s.setLong(2, e101.getGuild().getIdLong());
s.setLong(3, e101.getRole().getIdLong()); s.setLong(3, e101.getRole().getIdLong());
s.setBoolean(4, e101.wasMentionable()); s.setBoolean(4, e101.wasMentionable());
@ -1046,7 +1046,7 @@ public class EcouteurDEvents implements EventListener{
} }
public static void addRoles(long geid,List<Role> roles, Connection db) throws SQLException { public static void addRoles(long geid,List<Role> roles, Connection db) throws SQLException {
for(Role r : roles) { for(Role r : roles) {
PreparedStatement s = db.prepareStatement("INSERT INTO roles VALUES (NULL,?,?)"); PreparedStatement s = db.prepareStatement("INSERT INTO role VALUES (NULL,?,?)");
s.setLong(1, geid); s.setLong(1, geid);
s.setLong(2, r.getIdLong()); s.setLong(2, r.getIdLong());
s.executeUpdate(); s.executeUpdate();