12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Setting Properties<br />

databases (except for JDataStore) if you specify the dialect, then the Container<br />

automatically creates tables for container-managed entities for you. The Container will<br />

not create these tables unless you specify the dialect.<br />

However, the Container can detect the dialect from the URL for the JDataStore<br />

database. Thus, for JDataStore, the Container will create these tables regardless of<br />

whether you explicitly specify the dialect.<br />

The following table shows the names or values for the different dialects (case is<br />

ignored for these values):<br />

Database Name<br />

JDataStore<br />

Oracle<br />

Sybase<br />

MSSQLServer<br />

DB2<br />

Interbase<br />

Informix<br />

No database<br />

Dialect Value<br />

jdatastore<br />

oracle<br />

sybase<br />

mssql<strong>server</strong><br />

db2<br />

interbase<br />

informix<br />

none<br />

Mapping Java types to SQL types<br />

When you develop an enterprise bean for an existing database, you must map the SQL<br />

data types specified in the database schema to Java programming language data<br />

types.<br />

The <strong>Borland</strong> EJB Container follows the JDBC rules for mapping Java programming<br />

language types to SQL types. JDBC defines a set of generic SQL type identifiers that<br />

represent the most commonly used SQL types. You must use these default JDBC<br />

mapping rules when you develop an enterprise bean to model an existing database<br />

table. (These types are defined in the class java.sql.Types.)<br />

The following table shows the default SQL to Java type mapping as defined by the<br />

JDBC specification.<br />

Java type<br />

boolean/Boolean<br />

byte/Byte<br />

char/Character<br />

double/Double<br />

float/Float<br />

int/Integer<br />

long/Long<br />

short/Short<br />

String<br />

java.math.BigDecimal<br />

byte[]<br />

java.sql.Date<br />

java.sql.Time<br />

java.sql.Timestamp<br />

java.util.Date<br />

java.io.Serializable<br />

JDBC SQL type<br />

BIT<br />

TINYINT<br />

CHAR(1)<br />

DOUBLE<br />

REAL<br />

INTEGER<br />

BIGINT<br />

SMALLINT<br />

VARCHAR<br />

NUMERIC<br />

VARBINARY<br />

DATE<br />

TIME<br />

TIMESTAMP<br />

TIMESTAMP<br />

VARBINARY<br />

Chapter 14: Entity Beans and CMP 1.1 in <strong>Borland</strong> Enterprise Server 123

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!