Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


Introduction


Mimer JDBC Drivers provide access to Mimer SQL databases from Java applications and applets. The drivers are type 4 drivers, which means that they are written entirely in Java. As they are written in Java, they can be downloaded in applets.

Mimer JDBC Drivers can also be used on all platforms that support Java Virtual Machine (JVM) and so provide a very high degree of portability.

About this Guide

The guide is intended for Java application developers working with Mimer SQL. It covers all available Mimer JDBC drivers.

The guide describes the usage of SQL in Java applications, and provides, together with the Mimer SQL Reference Manual, the complete reference material for Mimer SQL.

To read more about JDBC and JVM, visit http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136101.html.

The JDBC API specification implemented by this driver (packages java.sql and javax.sql) is found at http://download.oracle.com/javase/1.4.2/docs/api/java/sql/package-summary.html and http://download.oracle.com/javase/1.4.2/docs/api/javax/sql/package-summary.html.

Definitions, Terms and Trademarks

API
Application Programming Interface
CLDC
Connected Limited Device Configuration
EJB
Enterprise Java Beans
JCP
Java Community Process
JDBC
The Java database API
JDK
Java Development Kit
JNDI
Java Naming and Directory Interface
JNI
Java Native Interface
JRE
Java Runtime Environment
JVM
Java Virtual Machine
KVM
K Virtual Machine, a compact portable JVM, intended for small, resource constrained devices
MIDP
Mobile Interface Device Profile
OCC
Optimistic Concurrency Control
PSM
Persistent Stored Modules, the term used by ISO/ANSI for stored procedures
SQL
Structured Query Language
URL
Uniform Resource Locator

All other trademarks are the property of their respective holders.

Available Drivers

At the moment, the following Mimer JDBC drivers are available:

Requirements

Driver
Mimer SQL Product
Java Runtime
mimjdbc3.jar
Mimer SQL 8.2 or later
JRE 1.4 or later
mimjdbc2.jar
Mimer SQL 8.2 or later
JRE 1.2 or later
mimjdbc1.jar
Mimer SQL 8.2 or later
JRE 1.1.8 or later
midjdbc2.jar
Mimer SQL 8.2 or later
J2ME CLDC 1.0.4/MID Profile 2.0 or CLDC 1.0/MID Profile 1.0 with extra support for the socket protocol within the Generic Connection Framework

Environment

Mimer JDBC has a complete range of functionality and support for the smallest devices to the high-end systems and application servers. In the picture below the various Java environments are described and coupled with computer environments and Mimer JDBC drivers:



In addition, the mimjdbc1 and mimjdbc2 drivers are available for older environments (see Available Drivers).

Differences Between the Drivers

In most cases the mimjdbc3 driver should be used. The mimjdbc1 and mimjdbc2 drivers should be used when only older Java runtime environments are supported. The minjdbc3 and midjdbc2 drivers are mainly for smaller and resource constrained environments.

The following table lists differences between the drivers:

Description
mimjdbc1
mimjdbc2
mimjdbc3
midjdbc2
Array Fetches
Yes
Yes
Yes
Yes
Batch Operations
No
Yes
Yes
Yes
CallableStatements
Yes
Yes
Yes
Yes
DatabaseMetaData Support
Yes
Yes
Yes
Yes
DataSource
No
Yes
Yes
Yes
Distributed Transactions (XA)
No
Yes
Yes
No
Driver identification support
Yes
Yes
Yes
No
Driver-class Support
Yes
Yes
Yes
No
Holdable cursors
No
No
Yes
No
java.sql.Blob, java.sql.Clob
No
Yes
Yes
Yes
JavaBean configuration
No
Yes
Yes
No
May be stored in connection pools
No
Yes
Yes
No
May be stored in JNDI
No
Yes
Yes
No
National character Support
Yes
Yes
Yes
Yes
Native SQL expansions
Yes
Yes
Yes
Yes
Parameter metadata
No
No
Yes
No
Scrollable ResultSets
No
Yes
Yes
Yes
Set FetchSize
No
Yes
Yes
Yes
SQL data types: BLOB, CLOB, and NCLOB
Yes
Yes
Yes
Yes
Updatable result sets
No
No
No
No

Note: A requirement for functionality support regarding to the table above is that the database server version used is supporting the functionality.

The default fetch size for the mimjdbc drivers is about 64 kB. In the minjdbc and midjdbc drivers the buffer size is 10 kB. This buffer size can be manipulated using the .setFetchSize method.

About the JDBC Driver for Midlets (midjdbc3)

The Mimer MIDP driver should be used in environments supporting the CLDC/MID Profile specification. It is a strict subset of the regular JDBC for CDC configurations API. Also applications developed with Mimer MIDP will run with little change in a regular JDBC environment and vice versa. Programming skills obtained using regular JDBC programming may be applied to programming within the MIDP environment as well.

The following features are omitted in the Mimer JDBC for MIDP:

Importing the JDBC Classes

Because the K Virtual Machine per default does not allow loading system class (java.*) applications accessing Mimer SQL databases should import the com.mimer.jdbc.* classes instead. This makes the application less portable than a regular JDBC application, but these are the constraints set by the environment.

The following Mimer classes correspond to the named interface classes in the regular JDBC API.

JDBC class
Mimer class
java.sql.BatchUpdateException
com.mimer.jdbc.BatchUpdateException
java.sql.Blob
com.mimer.jdbc.Blob
java.sql.CallableStatement
com.mimer.jdbc.CallableStatement
java.sql.Clob
com.mimer.jdbc.Clob
java.sql.Connection
com.mimer.jdbc.Connection
java.sql.DatabaseMetaData
com.mimer.jdbc.DatabaseMetaData
java.sql.DataSource
com.mimer.jdbc.MimerDataSource
java.sql.DataTruncation
com.mimer.jdbc.DataTruncation
java.sql.PreparedStatement
com.mimer.jdbc.PreparedStatement
java.sql.ResultSet
com.mimer.jdbc.ResultSet
java.sql.ResultSetMetaData
com.mimer.jdbc.ResultSetMetaData
java.sql.SQLException
com.mimer.jdbc.SQLException
java.sql.SQLWarning
com.mimer.jdbc.SQLWarning
java.sql.Statement
com.mimer.jdbc.Statement
java.sql.Types
com.mimer.jdbc.Types

See also the javadoc for the Mimer MIDP driver. It is available on the Mimer SQL Developer site: http://developer.mimer.com/documentation/latest_javadoc_midp/index.html.

FLOAT and DOUBLE PRECISION

Databases with FLOAT, DOUBLE PRECISION, REAL and INTEGER(n) columns which are required to expose these numbers in a MIDlet can use one the following tricks to go around the float and BigDecimal limitation in the K Virtual Machine.

  1. It is always possible to get the SQL FLOAT or DOUBLE PRECISION value into a java.lang.String. This will work particularly well if the data is only to be displayed.
  2. To handle fractions so that they may be used to some calculations, make sure at the SQL level to always return integers and reserving the last digits of the integer for decimals. If the database has a FLOAT column and we are interested in 4 decimals, do the following SQL:
 select cast(OUR_FLOAT*10000 as bigint) from OUR_TABLE
  1. At the application level, place the result in an int or a long, but assume that the last 4 digits are decimals when displaying values to the user. In addition, decimals entered by the user must be handled similarly by the application before being inserted to the database. The following SQL statement may be used to make the float appear correctly in a table.
 insert into OUR_TAB(OUR_FLOAT) values (cast(? as float)/10000);

DATE, TIME and TIMESTAMP

DATE, TIME and TIMESTAMP system classes (java.util.Date) are not included in the MIDP specification. Therefore the Mimer client cannot return DATE, TIME or TIMESTAMP objects. Please use string getter and setter methods instead.

Logging

To keep the driver size small and to optimize performance the Mimer JDBC drivers do not perform any logging. For logging, we provide a separate driver, Mimer JDBC Trace driver.

Mimer JDBC Trace driver is a full JDBC Driver that covers all of JDBC by calling the matching routines of the logged JDBC Driver.

It produces a log of every JDBC call an application makes, and also measures the elapsed time for each call. The log can be written to a file, or can be displayed directly in a window.

For more information, see http://developer.mimer.com/howto/howto_28.htm.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX