O'Reilly logo

Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams by Jamie Jaworski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Executing SQL Statements

SQL is the language that is used to interact with database servers. SQL statements can be used to add information to a database, update or delete existing database information, or retrieve information from a database. The purpose of the java.sql package is to allow you to execute SQL statements from Java. This section discusses the JDBC API interfaces that are used to execute SQL statements.

The Statement Interface

In the ResultApp program, you created an object of the Statement interface by invoking the createStatement() method of the Connection interface. You then invoked the executeQuery() method of the Statement interface, passing it the SELECT * FROM project SQL statement as an argument. This resulted in the database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required