DATABASE (more details).pptx - DATABASE(more details JDBC Interfaces ResultSet Represents the result of an SQL statement Provides methods for navigating

DATABASE (more details).pptx - DATABASE(more details JDBC...

This preview shows page 1 - 5 out of 9 pages.

DATABASE (more details)
Image of page 1
JDBC Interfaces ResultSet Represents the result of an SQL statement Provides methods for navigating through the resulting data PreparedStatement Similar to a stored procedure An SQL statement (which can contain parameters) is compiled and stored in the database CallableStatement Used for executing stored procedures DatabaseMetaData Provides access to a database's system catalogue ResultSetMetaData Provides information about the data contained within a ResultSet
Image of page 2
Connecting to a Database The connection is defined by URL The URL has the following form: jdbc: driver:databasename Examples: jdbc:odbc : MyOdbcDatabase jdbc : postgres : WebsiteDatabase jdbc : oracle : CustomerInfo A connection is obtained in the following manner: Connection aConnection = DriverManager.getConnection("jdbc:odbc:myDatabase"); Overloaded versions of the getConnection method allow the specification of a username and password for authentication with the database.
Image of page 3
Using a Connection
Image of page 4
Image of page 5

You've reached the end of your free preview.

Want to read all 9 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture