background image
<< XA and the Network Server | Error message differences >>

Embedded Mode and Network Server

<< XA and the Network Server | Error message differences >>
Derby Server and Administration Guide
30
2. Connect by specifying the URL:
ij> CONNECT 'jdbc:derby://localhost:1527/sample'
USER 'judy' PASSWORD 'no12see';
See
Network client driver examples
for additional URL examples.
Using the Derby dblook tool with the Network Server
To use the dblook tool with the Network Client driver, make sure the Network Server
is running (see
Starting the Network Server
), and then include the necessary Derby
and Network Client driver connection attributes as part of the database URL, as in the
following example:
java org.apache.derby.tools.dblook -d
'jdbc:derby://localhost:1527/sample;
user=user1;password=secret4me;'
For details on using the dblook tool, see the Derby Tools and Utilities Guide.
Differences between running Derby in embedded mode and using the Network
Server
This section describes the differences between running Derby in embedded mode and
using the Network Server. Note that there may be undocumented differences that have
not yet been identified.
Differences between the embedded client and the network client driver
The following are known differences that exist between the Derby embedded driver and
the network client driver. Note that there may be undocumented differences that have not
yet been identified. Some differences with the network client may be changed in future
releases to match the embedded driver functionality.
· Error messages and SQLStates can differ between the network client and
embedded driver. Some SQLStates may be null when using the network client,
particularly for data conversion errors.
· Multiple SQL exceptions and warnings will only return the SQLState of the first
exception when using the network client. The text of the additional exceptions will
be appended to the text of the first exception. See
Error message differences
.
· Treatment of error situations encountered during batch processing with
java.sql.Statement, java.sql.PreparedStatement and java.sql.CallableStatement is
different. With the embedded driver processing stops when an error is encountered;
with the network client driver processing continues, but an appropriate value as
defined in the java.sql.Statement api is returned in the resulting update count array.
· To use an encrypted user id and password, you need to have the IBM's Java
Cryptography Extension (JCE) Version 1.2.1 or later.
Updatable result sets
In Derby, the functionality of updatable result sets in a server environment and in an
embedded environment are similar, with the exception of the following differences:
· The Network Client requires that there be at least one column in the select list
from the target table. For example, the following statement will fail in a server
environment:
select 1, 2 from t1 for update of c11
The Network Client driver looks at both of the columns in the select list and cannot
determine the target table for update/delete by looking at the column metadata. This
requirement is not necessary in an embedded environment.
· The embedded driver allows for statement name changes when there is an open
result set on the statement object. This is not supported in a server environment.