: Connection URLs for the jadoZoom JDBC-Driver :
The URL for jadoZoom consists of 3 parts:
-
"jdbc:izmado:" - the driver identifier used by the java-sql package to locate
the driver
-
An ADO Connection String
-
jadoZoom-specific properties, which are added to the ADO connection string
The following example shows all 3 parts:
String url="jdbc:izmado:"
+ "Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\temp\test.mdb;"
+ "IzmJetCreateDB=IfNotExists;";
For more examples click here.
|
: The ADO Connection String :
For documentation of the ADO connection string see the following MSDN topics
|
: jadoZoom-specific Connection Properties :
jadoZoom supports the following set of connection properties in addition to
those passed to the OLEDB Provider level:
|
IzmDllPath
This property is used to specify the path of the native izmjniado.dll.
If jadoZoom doesn't find the DLL then the driver doesn't work.
If the IzmDllPath-property is not specified, then jadoZoom first tries
to load the DLL with the call the DLL first with a call to
System.loadLibrary("izmjniado").
If this fails it tries to load the dll with the hardcoded path
System.load("c:\\program files\\infozoom\\izmjniado.dll");
Note, that System.loadLibrary automatically checks various folders, such as the
jre/bin-folder and the Window/System32-folder.
Thus the IzmDllPath-property is needed only if the DLL is not found in
one of the mentioned folders.
Note, that if specified, the IzmDllPath property value must be the full path
including the file name.
|
IzmRoyaltyFree
This property is used when redistributing a licensed jadoZoom-version with an
application. The process of registering and redistributing a licensed jadoZoom
version is described in the readme.txt file, which is included with the
jadoZoom-download.
|
IzmJetCreateDB
This property is valid only with Access databases when using the provider Microsoft.Jet.Oledb.4.0.
It can be used to create a new Access database on the fly. The following values
can be specified:
-
No
- which is the default, opens the database and fails if it doesn't exist.
-
Always - creates a new, empty database, thereby an overwriting an
existing one.
This call fails, if the database already exists and can't be deleted, for
example because it is opened.
-
IfNotExists - opens an existing database, and if it doesn't exist,
creates a new one.
|
IzmJetCompactDB
This property is valid only with Access databases when using the provider Microsoft.Jet.Oledb.4.0.
It can be used to compact an Access database . The following values can be
specified:
-
No
- which is the default, does nothing.
-
OnClose
- compacts the database, after it is closed.
-
OnOpen
- compacts the database before opening it.
-
Yes - same as OnClose.
|
OpenMode
This property corresponds to the Connection.Mode property of ADO, which is
documented
here. The following values are supported:
-
Readonly
-
Exclusive
-
DenyNone
|
IzmConnectionTimeout
This property can be used to specify the Connection-timeout in seconds. It maps
to the AD0-property ConnectionTimeout.
|
IzmUnicode
This property is used to force the mapping of char- and string-parameters in
PreparedStatement and CallableStatement to NVARCHAR. Note that this is not
necessary with Access-databases. The following values are allowed:
-
No
- which is the default, maps to VARCHAR.
-
Yes - maps to NVARCHAR.
|
IzmJdbcEsc
This option enables SQL-preprocessing by jadoZoom in order to allow ODBC-escape
sequences with other datasources than the ODBC-provider MSDASQL. MSDASQL can
process escape sequences itself, thus this option should not be used with this
provider.
With other providers this option should only be used, if the
SQL statements do actually make use of escape sequences, because otherwise it
adds unnecessary processing overhead. The following values are allowed:
-
No
- which is the default, disables SQL-preprocessing.
-
Yes - enables SQL-preprocessing
|
IzmDateAsTimestamp
This property influences, how DatabaseMetaData and ResultSetMetaData report
Date-columns.
By default they are reported as java.sql.DATE, but when this propery is set to
Yes, they are reported as TIMESTAMP.
|
IzmThreadingModel
The following values are allowed:
-
Free
- which is the default, allows multithreaded access to a connection.
-
Apartment - increases performance but disallows multithreaded access to
a connection.
This property is related to the fact, that jadoZoom uses ADO on the native
side to access databases. ADO is a COM-component (COM = Component Object
Model).
ADO in turn uses OLE DB, which by itself is a database-driver model based on
COM. An OleDB-provider may be either threadsafe, or not threadsafe.
COM provides an automatic mechanism for shielding components, which are not
threadsafe, by automatically injecting proxy/stub-layers for multithreaded
clients.
As ADO is generic with respect to the underlying OleDB-provider, it declares
itself as not threadsafe, although it might actually be threadsafe, in order to
be on the safe side.
jadoZoom in turn runs by default as multithreaded client, thereby causing COM
to create a proxy/stub-layer for calls into ADO, which somewhat slows down
performance a bit.
With the use of the IzmThreadingModel-property this layer can be eliminated, as
jadoZoom registers itself with COM as single-threaded client. This doesn't
mean, that the whole java application must be single-threaded, but that all
operations on a specific connection must be from within the same thread, which
created the connection.
If this is the case, then one can safely set this property to Apartment.
|
Examples
Connecting to an Access Database using the native Jet-Oledb-Provider
The basic connection string is:
"jdbc:izmado:Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\\somefolder\\somemdb.mdb;"
If the database is locked with the database password, use:
"jdbc:izmado:Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\\somefolder\\somemdb.mdb;"
+ "Jet Oledb:Database Password=somepwd;"
If the database is secured with the workgroup user/password credentials use:
"jdbc:izmado:Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\\somefolder\\somemdb.mdb;"
+" User Id=someUser;Password=somepwd;"
If the database is secured with a specific workgroup file (System.mdw), use:
"jdbc:izmado:Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\\somefolder\\somemdb.mdb;"
+ "Jet OLEDB:System Database=c:\\somefolder\\mysystem.mdw;"
If the database needs to be created, if it doesn't exist:
"jdbc:izmado:Provider=Microsoft.Jet.OleDB.4.0;data
source=c:\\somefolder\\somemdb.mdb;"
+"IzmJetCreateDB=IfNotExists;"
|
|
Connecting to a MS Sql Server Database using the native SQLOLEDB-Provider
The basic connection string for SQL Server Authentication is:
"jdbc:izmado:Provider=SQLOLEDB;data
source=SERVERNAME;Initial catalog=DATABASENAME;User
Id=SomeUser;password=SomePwd;"
If integrated Windows Authentication is used, the connection string is:
"jdbc:izmado:Provider=SQLOLEDB;data
source=SERVERNAME;Initial catalog=DATABASENAME;Trusted_Connection=Yes;"
|
Connecting to an ODBC datasource using a DSN
DSN is the abbreviation for Data Source Name. A DSN is created using the ODBC
Datasource Administrator, which is opened from the Windows Control Panel,
Administrative Tools. Once a DSN is defined it can be used in the connection
string:
"jdbc:izmado:Provider=MSDASQL;DSN=DSNName;"
Using a DSN with the MSDASQL-provider is the default, thus the
Provider-property can be omitted, and the DSN alone suffices. The following
connection string is equivalent to the one above:
"jdbc:izmado:DSNName;"
If a DSN needs additional properties User and Password, then use the properties
UID and PWD:
"jdbc:izmado:DSNName;UID=SomeUser;PWD=SomePwd;"
|
Connection to an ODBC data source without using a DSN
If a DSN-less connection is to be established with the MSDASQL-provider, then
the name of the ODBC-driver is to be specified. For example, to open a DSN-less
connection to an Access Database through the ODBC driver:
"jdbc:izmado:Provider=MSDASQL;DRIVER={Microsoft
Access Driver (*.mdb)};DBQ=C:\...\NWind.mdb;"
Note that the correct driver name of a specific ODBC-driver can be looked up
using the ODBC Datasource Administrator.
|