Components of a JDBC connection – PB Docs 126

Components of a JDBC connection

How a JDBC connection is made

In PowerBuilder when you access a database through the JDBC
interface, your connection goes through several layers before reaching
the database. It is important to understand that each layer represents
a separate component of the connection, and that each component
might come from a different vendor.

Because JDBC is a standard API, PowerBuilder uses the same interface
to access every JDBC-compliant database driver.

Figure 3-1 shows
the general components of a JDBC connection.

Figure 3-1: Components of a JDBC connection

cnw3jdbc.gif

The JDBC DLL

PowerBuilder provides the pbjdb126.dll.
This DLL runs with the Java Runtime Environment (JRE) versions 1.1
and later.

PowerBuilder Java package

PowerBuilder includes a small package of Java classes that gives
the JDBC interface the level of error-checking and efficiency (SQLException catching) found in other PowerBuilder interfaces.
The package is called pbjdbc12126.jar and is
found in SAPSharedPowerBuilder.

The Java Virtual Machine

The Java Virtual Machine (JVM) is a component of Java development software.
When you install PowerBuilder, the Java Development Kit (JDK), including
the Java Runtime Environment (JRE), is installed on your system
in SAPSharedPowerBuilder.
For PowerBuilder 12.6, JDK 1.5 is installed. This version
of the JVM is started when you use a JDBC connection or any other process
that requires a JVM and is used throughout the PowerBuilder session.

If you need to use a different JVM, see the instructions in “Preparing to use the JDBC
interface”
. For more
information about how the JVM is started, see the chapter on deploying
your application in Application Techniques.

The JDBC drivers

The JDBC interface can communicate with any JDBC-compliant
driver including Sybase jConnect™ for JDBC (available with
SAP ASE, IQ, and SA database clients) and the Oracle and IBM Informix
JDBC drivers. These drivers are native-protocol, all-Java drivers—that
is, they convert JDBC calls into the SQL syntax
supported by the databases.

Accessing Unicode data

Using the ODBC interface, PowerBuilder can connect, save, and
retrieve data in both ANSI/DBCS and Unicode databases but
does not convert data between Unicode and ANSI/DBCS. When
character data or command text is sent to the database, PowerBuilder sends
a Unicode string. The driver must guarantee that the data is saved
as Unicode data correctly. When PowerBuilder retrieves character data,
it assumes the data is Unicode.

A Unicode database is a database whose character set is set
to a Unicode format, such as UTF-8, UTF-16, UCS-2, or UCS-4. All
data must be in Unicode format, and any data saved to the database
must be converted to Unicode data implicitly or explicitly.

A database that uses ANSI (or DBCS) as its character set might
use special datatypes to store Unicode data. Columns with these
datatypes can store only Unicode data. Any
data saved into such a column must be converted to Unicode explicitly.
This conversion must be handled by the database server or client.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x