EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Java; SQL Data Type Conversion

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Java / SQL data type conversion
294
Java / SQL data type conversion
When a Java class field or method is invoked within a SQL statement, a Java
data type is returned by the Java object. This must be converted into a SQL
data type for use within the SQL statement, for example in comparisons.
Similarly, when a SQL value is assigned to a Java class field, or supplied as
an argument to a Java class method, the SQL value must be converted to a
Java data type.
Java to SQL and SQL to Java data type conversions are carried out according
to the JDBC standard. The conversions are described in the following tables.
Java to-SQL-data type conversion
Java type SQL type
String CHAR
String VARCHAR
String TEXT
java.math.BigDecimal NUMERIC
java.math.BigDecimal MONEY
java.math.BigDecimal SMALLMONEY
boolean BIT
byte TINYINT
Short SMALLINT
Int INTEGER
long INTEGER
float REAL
double DOUBLE
byte[ ] VARBINARY
byte[ ] IMAGE
java.sql.Date DATE
java.sql.Time TIME
java.sql.Timestamp TIMESTAMP

Table of Contents

Related product manuals