File tree Expand file tree Collapse file tree
stickynote-core/src/main/kotlin/org/sayandev/stickynote/core/database/mysql Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ plugins {
88
99allprojects {
1010 group = " org.sayandev"
11- version = " 1.10.1"
11+ version = " 1.10.1.2 "
1212 description = " A modular Kotlin framework for Minecraft: JE"
1313
1414 plugins.apply (" maven-publish" )
Original file line number Diff line number Diff line change @@ -107,18 +107,22 @@ abstract class MySQLExecutor(
107107 getConnection().use { connection ->
108108 try {
109109 val preparedStatement = query.createPreparedStatement(connection)
110+
111+ val isUpdate = query.statement.startsWith(" INSERT" ) ||
112+ query.statement.startsWith(" UPDATE" ) ||
113+ query.statement.startsWith(" DELETE" ) ||
114+ query.statement.startsWith(" CREATE" ) ||
115+ query.statement.startsWith(" ALTER" )
110116 var resultSet: ResultSet ? = null
111117
112- if (query.statement.startsWith(" INSERT" ) ||
113- query.statement.startsWith(" UPDATE" ) ||
114- query.statement.startsWith(" DELETE" ) ||
115- query.statement.startsWith(" CREATE" ) ||
116- query.statement.startsWith(" ALTER" )
117- ) {
118+ if (isUpdate) {
119+ preparedStatement.closeOnCompletion()
118120 preparedStatement.executeUpdate()
119121 preparedStatement.close()
120122 }
121- else resultSet = preparedStatement.executeQuery()
123+ else {
124+ resultSet = preparedStatement.executeQuery()
125+ }
122126
123127 if (resultSet != null ) {
124128 query.complete(resultSet)
You can’t perform that action at this time.
0 commit comments