sql
9 tutorials tagged “sql”.
- CallableStatement in JavaCallableStatement calls stored procedures and functions: the call syntax, IN and OUT parameters, registerOutParameter and reading returned rows.
- Batch Processing in JDBCSend many SQL statements to the database in one trip with addBatch and executeBatch: how it works, batch sizes, transactions and handling failures.
- CRUD Operations with JDBCCreate, read, update and delete rows with JDBC in a small student application built around a DAO class, records, PreparedStatement and Optional.
- JDBC in JavaJDBC is the standard Java API for talking to relational databases. Learn what it is, its architecture, the main interfaces, and run a first query.
- ResultSet in JavaA ResultSet holds the rows of a query. Learn the cursor, getter methods, NULL handling with wasNull, and scrollable and updatable result sets.
- Statement Interface in JavaStatement runs fixed SQL: execute, executeUpdate and executeQuery, what each returns, reading generated keys, and when to use PreparedStatement instead.
- Transaction Management in JDBCMake several SQL statements succeed or fail together: auto-commit, commit, rollback, savepoints, ACID and isolation levels, with a money transfer example.
- PreparedStatement in JavaPreparedStatement runs SQL with ? parameters: setting values, reusing the statement, dates and NULL, and why it is safer and faster than Statement.
- Statement vs PreparedStatement (SQL Injection)See a real SQL injection attack on a login check, why joining strings into SQL is dangerous, how PreparedStatement stops it, and a full comparison.