JDBC for Oracle - Herong's Tutorial Examples - v3.13, by Herong Yang
Installation of JdbcRowSet Reference Implementation
This section describes how to download and install JdbcRowSet Reference Implementation.
The reference implementation of JdbcRowSet API was provided by Sun Microsystems. Since JDK 1.7, the Sun implementation is included in the JDK package now as the default implementation.
To access the Sun implementation, you can use methods from the RowSetProvider class and the RowSetFactory class:
// Creating an instance of the default RowSetFactory implementation RowSetFactory f = RowSetProvider.newFactory(); // Creating an instance of JdbcRowSet from the factory JdbcRowSet s = f.createJdbcRowSet();
Here is a tutorial program that shows how to create a JdbcRowSet object with the Sun default implementation:
/* OracleRowSetFactory.java * Copyright (c) HerongYang.com. All Rights Reserved. */ import java.sql.*;; import javax.sql.rowset.RowSetProvider; import javax.sql.rowset.RowSetFactory; import javax.sql.rowset.JdbcRowSet; public class OracleRowSetFactory { public static void main(String [] args) { try { RowSetFactory f = RowSetProvider.newFactory(); JdbcRowSet s = f.createJdbcRowSet(); System.out.println("RowSetFactory: "+f.getClass().getName()); System.out.println("JdbcRowSet: "+s.getClass().getName()); } catch (Exception e) { e.printStackTrace(); } } }
Compile and run it with JDK 1.8, you will get the following output:
herong> java OracleRowSetFactory RowSetFactory: com.sun.rowset.RowSetFactoryImpl JdbcRowSet: com.sun.rowset.JdbcRowSetImpl
The output confirms that Sun implementation of JdbcRowSet API is the default implementation.
If you are using JDK 1.6, you need to download and install the Sun implementation JAR file. I followed these steps to download and install Sun's reference implementation package:
The installation is done. But don't forget to read the API documentation at \local\jdbc_rowset\doc\index.html.
Table of Contents
JDBC (Java Database Connectivity) Introduction
Oracle Express Edition Installation on Windows
►Oracle - Reference Implementation of JdbcRowSet
►Installation of JdbcRowSet Reference Implementation
Connecting JdbcRowSet to Database Servers
Connecting JdbcRowSet with a Connection URL
Connecting JdbcRowSet with a Predefined Connection Object
Connecting JdbcRowSet with a Predefined ResultSet Object
Connecting JdbcRowSet with JNDI Directory Service
JdbcRowSet Query Statement with Parameters
Inserting Rows with JdbcRowSet Objects
Oracle - JBDC CallableStatement
Oracle CLOB (Character Large Object) - TEXT
Oracle BLOB (Binary Large Object) - BLOB