oracle database 10 java db jdbc database web services
TRANSCRIPT
Oracle Database 10g Java DB
JDBC Database Web Services
2005 5
Oracle Database 10g Java DB JDBC Database Web Services 2
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Oracle Database 10g Java DB JDBC
Database Web Services
............................................................................................................................ 3
JDBC ......................................................................................................... 3
Oracle Database 10g Release 1 JDBC .................... 3
............................................................................................ 3
/ / / / .................................. 4
Oracle Database 10g Release 2 JDBC .............................. 5
............................................................................................ 5
/ / / / .................................. 5
JDBC .............................................................................. 6
Connection Cache Manager........................................................................... 6
Implicit Connection Cache............................................................................. 9
Fast Connection Fail-Over........................................................................... 15
................................. 17
Java ................................................................ 17
Java .......................................................... 17
Oracle Database 10g Release 1 Java DB .............. 17
Oracle Database 10g Release 2 Java DB ........................ 18
Jpublisher Database Web Services ............................................ 19
Database Web Services ...................................................................................... 19
Oracle Database 10g Release 1 JPublisher
Database Web Services ......................................................................... 19
Oracle Database 10g Release 2 JPublisher
Database Web Services ..................................................................... 20
.......................................................................................................................... 20
Oracle Database 10g Java DB JDBC Database Web Services 3
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Oracle Database 10g Java DB JDBC
Database Web Services
Oracle Database 10g Release 1 Java OracleJVM
Oracle JDBC Oracle Database Web Services
Oracle Database 10g Release 2 Oracle
Oracle Database 10g Release 1 Release 2
Java JDBC Web Services
(i)
(ii)
(iii) Oracle
Java and Web Services Developers Perspective on Oracle
Database 10g
JDBC
Oracle Database 10g Release 1 JDBC
Oracle9i Release 2 JDBC
PreparedStatement
JDBC JDK 1.4x
JDBC 3.0 Oracle Database 10g Release 1
JDBC JDBC 3.0
: CallableStatement PreparedStatement
JDBC
REF Datalink: DATALINK
JDBC 3.0
JDBC Java java.net.URL
J2EE Connector Architecture Resource Adapter: Oracle JDBC Oracle
JCA
: Implicit Connection Cache JDBC 3.0
Oracle
Oracle Database 10g Java DB JDBC Database Web Services 4
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
JDBC Web RowSet JSR-114 : API Web Services
J2EE
XML
Oracle Database 10g Release 1 JDBC
JSR-114
/ / / /
: Web SQL
Web ID RDBMS
JDBC
Oracle JDBC Datum : Datum
Datum JDBC
SQLException Datum
Instant Client JDBC-OCI : JDBC-OCI
IEEE DOUBLE IEEE FLOAT : Java J2EE
LONG LOB : CLOB BLOB LONG RAW LONG
RAW
LOB: 4
VARRAY :
PL/SQL : PL/SQL 4 Thin JDBC
: 4 Thin JDBC 3DES112
3DES168
XA: 4 Thin JDBC JDBC XA
JDBC-Thin : /
Oracle Database 10g Java DB JDBC Database Web Services 5
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Oracle Database 10g Release 2 JDBC
Oracle Database 10g Release 2 JDBC 100% JDBC 3.0
• JDBC 3.0 : Oracle
JDBC 3.0
3
java.sql.DatabaseMetaData java.sql.Statement
java.sql.Connection
° JDBC Oracle
DML
• JDBC 3.0 :
ResultSet
Oracle JDBC Oracle
ResultSet.HOLD.CURSORS_OVER_COMMIT
JDBC RowSet JSR-114: Oracle Database 10g Release 2 JDBC JDK 5.0
JSR-114 Rowset
JavaBeans Rowset 5 JdbcRowSet CachedRowSet WebRowSet
FilteredRowSet JoinRowSet JAXP 1.2
SAX 2.0 DOM W3C XML
/ / / /
JDBC-OCI : JDBC-Thin
RAC/ / : JDBC
RAC
RAC
SSL JDBC-Thin : JDBC JSSE
description PROTOCOL=tcps
TNSNAMES.ORA JDBC-Thin :
JDBC-OCI JDBC-Thin TNSNAMES.ORA
Java
Oracle
JDBC
Oracle Database 10g Java DB JDBC Database Web Services 6
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
XA
JDBC XA
ERP
JDBC
Oracle Database 10g JDBC
RAC GRID
Implicit Connection Cache Fast Connection
Failover JDBC Runtime Load Balancing
Connection Cache Manager
Connection Cache Manager
Connection Cache Manager VM
Connection Cache Manager JDK/JVM
Connection Cache Manager
Connection Cache Manager
Connection Cache Manager
2
Connection Cache Manager
API
Connection Cache Manager DataSource
DataSource
DataSource
Connection Cache Manager
DataSource /
DataSource
getConnection()
: Connection Cache Manager
DataSource
Connection Cache Manager API
DataSource
Oracle Database 10g Java DB JDBC Database Web Services 7
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
DataSource DataSource
Oracle Database 10g Java DB JDBC Database Web Services 8
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Connection Cache Manager
Application Server Connection Cache Manager
Connection Cache Manager
JVM Oracle
Connection Cache Manager
DataSource close() API DataSource
DataSource Connection
Cache Manager
MinLimit: PooledConnections
1
InitialLimit 0
MaxLimit: PooledConnections
unbound MaxLimit
InitialLimit:
0
0
Implicit Connection Cache
PooledConnections PooledConnections
1 OracleConnectionCacheImpl
Oracle Database 10g Java DB JDBC Database Web Services 9
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
API Connection Cache Manager
int getNumberOfAvailableConnections(String cacheName)
API
API
int getNumberOfActiveConnections(String cacheName)
API
API
java.util.properties getCacheProperties(String cacheName)
String[] getCacheNameList()
API Connection Cache Manager
Connection Cache Manager API
Implicit Connection Cache
Implicit Connection Cache
Implicit Connection Cache
AbandonedConnectionTimeout
2
2 SQL
Oracle Database 10g Java DB JDBC Database Web Services 10
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
MaxStatementsLimit
0
REFRESH_INVALID_CONNECTIONS REFRESH_ALL_CONNECTIONS 2
• REFRESH_INVALID_CONNECTIONS
PooledConnection3
PooledConnection
• REFRESH_ALL_CONNECTIONS
Implicit Connection Cache
1: NLS_LANG
// Look up the datasource object
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup(MyOracleDataSource);
// get a connection from MyCache
java.util.Properties connAttr = null;
connAttr.setProperty(“NLS_LANG”, “ISO-LATIN-1”);
conn = ds.getConnection(connAttr); // retrieve connection -
NLS_LANG
…
conn.applyConnectionAttributes(connAttr); // apply attributes
Statement stmt = conn.createStatement();
stmt.execute(“select empname from emp”);
…
conn.close(); // release the connection back to MyCache
2:
…
java.util.Properties connAttr = null;
connAttr.setProperty(“TRANSACTION_ISOLATION”,
“SERIALIZABLE”);
conn = ds.getConnection(connAttr); // retrieve connection that
matches Transaction Isolation
3 select 1 from dual
Oracle Database 10g Java DB JDBC Database Web Services 11
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
…
conn.close(connAttr); // another way to apply attributes to the
connection
3:
…
java.util.Properties connAttr = null;
connAttr.setProperty(“CONNECTION_TAG”, “JOE’S_CONNECTION”);
conn = ds.getConnection(connAttr); // retrieve connection that
matches Joe’s connection
…
conn.close(connAttr); // apply attributes to the connection
…
conn = ds.getConnection(connAttr); // This will retrieve Joe’s
connection
CacheAttributeWeight java.util.Properties
ConnectionAttribute
getConnection(connectionAttributes)
•
• connectionAttributes
CacheAttributeWeights
java.util.properties cacheProps = new Properties();
java.util.properties cacheWeights = null;
cacheWeights.setProperty(“NLSLANG”, “10”);
cacheWeights.setProperty(“SecurityGroup”, “8”);
cacheWeights.setProperty(“Application”, “4”);
…
// set weights on the cache
cacheProps.put(CacheAttributeWeights, cacheWeights);
…
java.util.properties connAttr = null;
connAttr.setProperty(“NLSLANG”, “ISO-LATIN-1”);
connAttr.setProperty(“SecurityGroup”, “1”);
connAttr.setProperty(“Application”, “HR”)
// Request connection
ds.setCacheName(“MyCache”);
Oracle Database 10g Java DB JDBC Database Web Services 12
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
// First retrieval of connection from myCache
conn = ds.getConnection(connAttr);
…
conn.close(connAttr); // apply attributes on the connection
…
// Next retrieval finds the connection in the cache
conn = ds.getConnection(connAttr);
…
getConnection() MyCache
• : NLS_LANG
SecurityGroup Application
• : ClosestConnectionMatch
NLS_LANG APPLICATION SECURITY_GROUP
connection1
10 NLS_LANG connection2 12
SECURITY_GROUP APPLICATION
connection2
connection1 connection2
connectionAttributes
DataSource
getUnMatchedConnectionAttributes() API
java.util.Properties
2 1
applyConnectionAttributes(java.util.properties connAttr) API
API
A
API NLS_LANG B
TXN_ISOLATION 2
close(java.util.properties connAttr) API
API
PooledConnection close() API
Oracle Database 10g Java DB JDBC Database Web Services 13
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
applyConnectionAttributes() API
Oracle Database 10g Java DB JDBC Database Web Services 14
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
close(connectionAttributes) API
API PooledConnection
connectionAttributes PooledConnection
// Sample connection request and close
java.util.properties connAttr = null;
connAttr.setProperty(“NLSLANG”, “ISO-LATIN-1”);
conn = ds.getConnection(connAttr); // request connection based
on attributes
java.util.properties unmatchedAttr =
conn.getUnMatchedConnectionAttributes();
…
--- App Server code applies unmatched attributes to the
connection, either by
calling PL/SQL procedures or SQL, before using the connection.
---
--- work ---
…
conn.close(connAttr); // apply attributes to connection
Fast Connection Fail-Over
Fast Connection Failover Implicit Connection Cache RAC
RAC
RAC
2 2 RAC
100
50 RAC
1 50
Fast Connection Failover
RAC
DataSource FastConnectionFailoverEnabled true
DataSource
Oracle Database 10g Java DB JDBC Database Web Services 15
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
// Example to show binding of OracleDataSource to JNDI
// with relevant cache properties set on the DataSource.
import oracle.jdbc.pool.*; // import the pool package
Context ctx = new IntialContext(ht);
OracleDataSource ods = new OracleDataSource();
// Set DataSource properties
ods.setUser(“Scott”);
ods.setPassword(“tiger”);
ods.setConnectionCachingEnabled(True);
ods.setConnectionCacheName(“MyCache”);
ods.setConnectionCacheProperties(cp);
setURL("jdbc:oracle:thin:@(DESCRIPTION= (LOAD_BALANCE=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service_name)))");
ods.setFastConnectionFailoverEnabled(true); // Enable fast
connection failover
ctx.bind(“MyDS”, ods);
…
ds = lookup(“MyDS”); // lookup DataSource from the cache
// implicitly create connection cache, that is set up for fast
connection failover
conn = ds.getConnection();
…
conn.close(); // return connection to the cache
…
ods.close() // close datasource and cleanup the cache
Fast Connection Failover Service DOWN Service UP
Host DOWN DOWN
UP
Fast Connection Failover
RAC
:
Implicit Connection
Cache Fast Connection Failover
RAC UP :
RAC
RAC
Oracle Database 10g Java DB JDBC Database Web Services 16
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Oracle Database 10g Release 1 RAC
TNS Listener
Oracle Database 10g Release 2 RAC
30 RLB
RAC Automatic Workload Repository AWR
Oracle JDBC Connection Cache Manager RAC
RLB RLB
RAC
Java
Java
Java PL/SQL
Java RDBMS
J2EE POJOS JDBC
Java
Java Java
Java
Oracle Database 10g Release 1 Java DB
OracleJVM Java JCE
JSSE Headless AWT JAXP J2SE 1.4
OracleJVM
Java
JDBC
loadjava
EJB HttpClient RMI/JRMP RMI/IIOP SOAP
Oracle Database 10g Java DB JDBC Database Web Services 17
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
JPublisher Call Spec PL/SQL
Java
Oracle Database 10g Release 2 Java DB
OracleJVM
PGA_AGGREGATE_TARGET SQL
OracleJVM GC
Java Audit
Oracle Database 10g Release 2 PL/SQL SQL
Java / SQL Audit
Java Java Java
Java Audit
Java Audit SQL
CREATE JAVA SOURCE CREATE JAVA SOURCE
CREATE OR REPLACE JAVA SOURCE
ALTER JAVA RESOURCE ALTER JAVA RESOURCE
DROP JAVA SOURCE DROP JAVA SOURCE
CREATE JAVA CLASS CREATE JAVA CLASS
CREATE OR REPLACE JAVA CLASS
ALTER JAVA CLASS ALTER JAVA CLASS
DROP JAVA CLASS DROP JAVA CLASS
CREATE JAVA RESOURCE CREATE JAVA RESOURCE
CREATE OR REPLACE JAVA RESOURCE
ALTER JAVA RESOURCE ALTER JAVA RESOURCE
DROP JAVA RESOURCE DROP JAVA RESOURCE
Oracle Database 10g Java DB JDBC Database Web Services 18
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Jpublisher Database Web Services
Database Web Services
Database Web Services
• Web Services
Web Services
Web Services
• Web Services
SQL
Web Services
IRS
• Oracle Application Server Web Services
Web Services WS-Security
WS-Relaiability WS-Management SOAP/HTTP
Service Oriented Architecture
Oracle Database 10g Release 1 JPublisher
Database Web Services
JPublisher
JDBC : NCHAR Timestamp SQLJ SQL
Opaque
PL/SQL
Java
Database Web Services
• WSDL Java PL/SQL
Web Services
•
• Web Services PL/SQL Java SQL
SQL DML
• PL/SQL CLOB BLOB
• REF CURSOR
Oracle Database 10g Java DB JDBC Database Web Services 19
Oracle Corporation What’s New for Java DB, JDBC, and Database Web Services in Oracle Database 10g
Oracle Database 10g Release 2 JPublisher Database
Web Services
• Java JDBC
• Web Services Streams/Advance Queue
• Web Services
•
• SQLJ JDBC
Oracle Database 10g Release 1 Release 2
Java JDBC Web Services
Web Services
RAC
Oracle Database 10g Java DB JDBC Database Web Services
2005 5
: Kuassi Mensah
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
:
: +1.650.506.7000
: +1.650.506.7200
www.oracle.com
Copyright © 2005, Oracle. All rights reserved.
Oracle JD Edwards PeopleSoft Oracle Corporation