You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tx.createQuery("INSERT INTO users (name, email) VALUES (:name, :email)")
177
+
.addParameter("name", "Bob")
178
+
.addParameter("email", "bob@example.com")
179
+
.executeUpdate();
180
+
181
+
tx.createQuery("UPDATE users SET email = :email WHERE name = :name")
182
+
.addParameter("name", "Alice")
183
+
.addParameter("email", "alice_new@example.com")
184
+
.executeUpdate();
185
+
186
+
tx.commit(); // commit transaction
146
187
}
147
188
```
148
189
190
+
- Always use parameter binding (:param) to avoid SQL injection.
191
+
- Prefer try-with-resources so connections are closed automatically.
192
+
- Transactions can be used with beginTransaction() to group multiple queries.
193
+
- Hikari settings are configured via YAML (config.yml) and applied automatically via your Database classes.
194
+
149
195
## Libraries
150
196
151
197
[**PowerNukkitX**](https://github.com/PowerNukkitX/PowerNukkitX) is a branch version based on PowerNukkit,
@@ -154,8 +200,7 @@ developed and maintained by PowerNukkitX.
154
200
[**MariaDB Connector**](https://github.com/mariadb-corporation/mariadb-connector-j) MariaDB Connector/J is a Type 4 JDBC
155
201
driver. It was developed specifically as a lightweight JDBC connector for use with MariaDB and MySQL database servers.
156
202
157
-
[**Jdbi**](https://github.com/jdbi/jdbi) The Jdbi library provides convenient, idiomatic access to relational databases
158
-
in Java.
203
+
[**sql2o**](https://github.com/aaberg/sql2o) A lightweight Java library for working with SQL databases. Provides clean, minimalistic ORM-style mapping between database rows and Java objects.
159
204
160
205
[**HikariCP**](https://github.com/brettwooldridge/HikariCP) is a "zero-overhead" production ready JDBC connection pool.
0 commit comments