Connection Pooling in JDBC: How It Works and How to Use It
Connection pooling reuses open database connections instead of creating one per request. See how it works and how to set up HikariCP in Java and Spring Boot.
42 posts about SQL: questions with answers, tutorials and articles, newest first.
Connection pooling reuses open database connections instead of creating one per request. See how it works and how to set up HikariCP in Java and Spring Boot.
Run SELECT and INSERT queries with JDBC using PreparedStatement and try-with-resources, and learn why concatenated SQL is unsafe.
JDBC is the standard Java API for connecting to relational databases. See how drivers, connections, prepared statements, transactions and pooling fit together.
Hibernate removes JDBC boilerplate with object mapping, caching and portability. See examples and when plain JDBC is the better choice.
Hibernate is an ORM layer that runs on top of JDBC. See how the two relate, compare code side by side, and learn when plain JDBC is the better tool.
The main steps to connect to a database using JDBC: add the driver, open a Connection, run PreparedStatement queries, close resources, and use a connection pool.
Disable auto-commit, run statements on one connection, then commit or roll back. Includes savepoints, isolation levels and batching.
The ResultSet interface is how a Java program reads the rows a SQL query returns. See navigation, typed getters, updatable cursors, metadata and safe cleanup.
DriverManager is the JDBC class that selects a registered driver and opens a Connection from a JDBC URL. It does no pooling, so production code uses a DataSource.
Go beyond a single query with JDBC: pooled connections, PreparedStatement, batching, transactions and stored procedures in current Java.
JDBC is the standard Java API for connecting to relational databases. Learn drivers, connections, PreparedStatement, transactions, batching and connection pooling.
Statement runs static SQL, PreparedStatement binds parameters safely, and CallableStatement calls stored procedures. Learn which to use and why.
Connect Java to a database with JDBC using try-with-resources, PreparedStatement, transactions and a HikariCP pool, with the current MySQL driver.
JDBC is the standard Java API for connecting to relational databases, running SQL and managing transactions. See how it works with current best practices.
Never build SQL from user input. Use parameter placeholders or an ORM, allow-list identifiers, and run with least-privilege database accounts.
Go has no built-in migration tool. See how to version SQL files, build a minimal runner with embed, and choose golang-migrate, goose or Atlas.
Use Go's database/sql package to open a pool, run safe parameterised queries, handle missing rows and wrap changes in transactions, with working code.
A practical tour of data storage in Go: database/sql with pooling and transactions, NoSQL clients, atomic file writes, in-memory caches and when to use an ORM.
Learn database/sql in Go: connection pooling, parameterised queries, scanning rows, transactions and other standard-library storage options.
A practical guide to Go database integration: database/sql, drivers, parameterised queries, transactions, connection pooling, and tools like sqlx and sqlc.