+ All Categories
Home > Documents > DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge®...

DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge®...

Date post: 05-Jan-2016
Category:
Upload: irma-warner
View: 220 times
Download: 2 times
Share this document with a friend
34
DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development
Transcript
Page 1: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology

What’s new in OpenEdge® 10.1A?

Rob StewardDirector of Software Development

Page 2: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation2DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Agenda

ODBC architecture changes ODBC Unicode functionality JDBC architecture changes JDBC JTA support

What’s New in 10.1A?

Page 3: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation3DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Agenda

ODBC architecture changes ODBC Unicode functionality JDBC architecture changes JDBC JTA support

What’s New in 10.1A?

Page 4: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation4DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

ODBC “Classic” Architecture

Application Code

Driver Manager

ODBCDriver

A

ODBCDriver

B

ODBCDriver

C

NetworkLib

NetworkLib

NetworkLib

A B C

•Data Protocol•Wire Protocol

Page 5: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation5DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

ODBC Wire Protocol Architecture

Application Code

Driver Manager

ODBCDriver

A

ODBCDriver

B

ODBCDriver

C

A B C

•Data Protocol•Wire Protocol

OpenEdge Wire Protocol Driver

•Higher Performance•No Dependencies•Thin client install

Page 6: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation6DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

OpenEdge Wire Protocol Advantages

Ease of Deployment

Versioning• 10.1A will be forward compatible with future

versions of the database

Better performance

Page 7: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation7DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

How Database Middleware Works

DBMSSERVER

Packets sentfrom driver

2

Packets sentback fromDBMS Server

3

DRIVER

API CALL

DATABASENETWORK

NETWORK

select * fromemployees where location = ‘boston’

Applicationmakes a call

1

Page 8: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation8DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Why better performance?

NETWORK

NETWORK

SIMULTANEOUS

Applicationmakes a call

Packets sentfrom driver

Packets sentback fromDBMS Server

1

2

3

3

BUFFER

Private BUFFER

Only one network read to process allpackets. This occurs simultaneously asthe DBMS server sends more packets

DRIVER

API CALL

DBMSSERVER

DATABASE

different sized packets

Page 9: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation9DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

ODBC Wire Protocol Availability

New driver available in 10.1A!• Compatible with 10.1A servers

Platforms• Windows 98/Me/NT/2000/XP/2003• AIX• Solaris• HP-UX

Page 10: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation10DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Agenda

ODBC architecture changes ODBC Unicode functionality JDBC architecture changes JDBC JTA support

What’s New in 10.1A?

Page 11: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation11DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

What is Unicode?

One character set standard to rule them all A single encoding standard to represent “all” written

characters-glyphs Unicode 4.0 contains over 96,000 characters Three Common Flavors

• UCS-2 (strictly 2 bytes)

• UTF-8 (1 to 4 bytes; preserves ASCII; favored by Unix)

• UTF-16 (UCS-2 + surrogates)

Page 12: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation12DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Why Unicode?

Internationalizes your code

Performance – can avoid costly character set translations

Page 13: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation13DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Unicode Support in the ODBC Standard

Unicode support added in version 3.5 Spec assumes UCS-2 Separate API calls for Unicode strings (“W” functions) Separate data types for Unicode strings (SQL_C_WCHAR) ODBC Driver Manager masks driver and application

differences

Page 14: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation14DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

What does Unicode Support Encompass at the ODBC API level?

Arguments to API functions/methods String parameters String results

Page 15: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation15DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

How does Unicode work in ODBC?

Unicode App vs. non-Unicode app. • “W” functions

Unicode Driver vs. non-Unicode driver. • SQLConnectW exported?

Page 16: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation16DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

How does Unicode work in ODBC? (cont.)

DM tries to make all possible combinations work.• ANSI App w/ ANSI driver

• Unicode App w/ Unicode driver

• ANSI App w/ Unicode driver

• Unicode App w/ ANSI driver (obvious limitations)

• Unix Only: UTF8 app w/ UTF-16 driver.

• Unix Only: UTF-16 app w/ UTF8 driver.

Page 17: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation17DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Why are Character Set Conversions Bad?

Degrades performance. Frequently data is lost (Substituted), or corrupted

during conversions. For example, here’s how the Euro character, “€”, is

represented in various character sets:

ISO8859-1:               N/A

Cp1252:                    0x80

UCS-2/UTF-16:  0x20AC

UTF-8 : 0xE2A2AC

Page 18: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation18DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

When are Conversions Necessary and Why?

Conversions by DM• Non-Unicode apps

• Non-Unicode drivers

Conversions by Unicode Driver• Between Unicode and DB codepage for

SQL when DB’s codepage is not Unicode

• Conversions for parameters and result columns as necessary based on C type and SQL type

Page 19: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation19DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Agenda

ODBC architecture changes ODBC Unicode functionality JDBC architecture changes JDBC JTA support

What’s New in 10.1A?

Page 20: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation20DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Architecture differences in JDBC drivers

The JDBC specification formally defines 4 different types of drivers• Type 1: JDBC-ODBC bridge

• Type 2: partial Java™ driver

• Type 3: pure Java driver for database middleware

• Type 4: pure Java driver for direct-to-database

Page 21: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation21DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

JDBC Architecture – Type 1

•Authored by DataDirect•Free with JDK•JDBC 2.0 API•For Prototyping

ODBC Driver Manager

ODBCDriver

A

ODBCDriver

B

ODBCDriver

C

A B C

JDBC/ODBC BridgeApplication Code

Page 22: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation22DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

JDBC Architecture – Type 2

Application Code

JDBCDriver

A

JDBCDriver

B

JDBCDriver

C

NetworkLib

NetworkLib

NetworkLib

A B C

•Platform Dependent

Page 23: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation23DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

JDBC Architecture – Type 4

Application Code

JDBCDriver

A

JDBCDriver

B

JDBCDriver

C

A B C

OpenEdge 10.1A Type 4 Driver

•No Client Dependencies•More Platforms•Better Performance

Page 24: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation24DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

JDBC Architecture

OpenEdge 10.1A Driver• Type 4

• JDBC 3.0 API

• CTS Certified

Java Application Code

JDBCDriver

A

JDBCDriver

B

JDBCDriver

C

A B C

Page 25: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation25DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

OpenEdge Type 4 JDBC Advantages

Ease of Deployment

Versioning• No dependence on native code

No platform dependence• Any J2SE 1.4 or higher

Better performance

Page 26: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation26DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Agenda

ODBC architecture changes ODBC Unicode functionality JDBC architecture changes JDBC JTA support

What’s New in 10.1A?

Page 27: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation27DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

What is JTA?

JTA is the Java Transaction API

JTA specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the resource manager, the application server, and the transactional applications.

JTA is based on the XA specification

Page 28: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation28DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Why is JTA important?

All common application servers support XA transactions through JTA and they will use them if necessary and available

If you need to enlist OpenEdge connections in a distributed transaction with some other data source

Page 29: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation29DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

How Does JTA work?

1 UserTransaction

javax.transaction.UserTransaction

Provides the application the ability to control transaction boundaries. It starts a

global transaction and associates the transaction with the calling thread.

2 TransactionManager

javax.transaction.TransactionManager

Allows the application server to control transaction boundaries on behalf of the

application being managed.

3 XAResource javax.transaction.xa.XAResource

A Java mapping of the industry standard XA interface.

Page 30: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation30DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

A Distributed Transaction with JTA

. . .

xaDS = getDataSource();

xaCon = xaDS.getXAConnection("jdbc_user", "jdbc_password");

xaRes = xaCon.getXAResource();

con = xaCon.getConnection();

stmt = con.createStatement();

xid = new MyXid(100, new byte[]{0x01}, new byte[]{0x02});

Page 31: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation31DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

A Distributed Transaction with JTA

xaRes.start(xid, XAResource.TMNOFLAGS);

stmt.executeUpdate("insert into test_table values (100)");

xaRes.end(xid, XAResource.TMSUCCESS);

ret = xaRes.prepare(xid);

if (ret == XAResource.XA_OK) { xaRes.commit(xid, false);

}...

Page 32: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation32DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Questions?

Page 33: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation33DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology

Thank you foryour time

Page 34: DB-1: Understanding and Leveraging the Latest ODBC and JDBC Technology What’s new in OpenEdge® 10.1A? Rob Steward Director of Software Development.

© 2006 Progress Software Corporation34DB-1: Understanding & Leveraging Latest ODBC and JDBC Technology


Recommended