O'Reilly logo

Just Java™ 2 by Peter van der Linden

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

Now we are at the point where we can start issuing SQL commands to our database and getting back results. We do this through a Statement object that we get from the connection object described in the previous section. Table 24-4 shows several methods in Connection.

Table 24-4. Some methods of java.sql.Connection

Method

Purpose

Statement createStatement()

Returns a statement object that is used to send SQL to the database.

PreparedStatement prepareStatement(String sql)

Returns an object that can be used for sending parameterized SQL statements.

CallableStatement prepareCall(String sql)

Returns an object that can be used for calling stored procedures.

DataBaseMetaData getMetaData()

Gets an ...

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