Data Mgmt Lab_Part_22 - 64 Chapter 6 Exercise 6.2 Explain...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 64 Chapter 6 Exercise 6.2 Explain how the following steps are performed in JDBC: 1. Connect to a data source. 2. Start, commit, and abort transactions. 3. Call a stored procedure. How are these steps performed in SQLJ? Answer 6.2 The answers are given below: 1. Connecting to a data source in JDBC involves the creation of a Connection object. Parameters for the connection are specified using a JDBC URL that contains things like the network address of the database server and the username and password for connecting. SQLJ makes calls to the same JDBC drver for connecting to a data source and uses the same type of JDBC URL. 2. Each connection can specify how to handle transactions. If the autocommit ag is set, each SQL statement is treated as a separate transaction. If the ag is turned off, there is a commit() function call that will actually commit the transaction. The autocommit ag can also be set in SQLJ. If the ag is not set, transactions are committed by passing a COMMIT SQL statement to the DBMS. 3. Stored procedures are called from JDBC using the CallableStatement class with the SQL command { CALL StoredProcedureName } . SQLJ also uses CALL StoredProcedureName to execute stored prodecures at the DBMS....
View Full Document

This note was uploaded on 01/17/2012 for the course EGN 4302 taught by Professor Dr.vishak during the Fall '12 term at University of Central Florida.

Page1 / 3

Data Mgmt Lab_Part_22 - 64 Chapter 6 Exercise 6.2 Explain...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online