|
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)
HXTT Excel
|
Support for metadata calls in HXTT Excel JDBC driver |
Damodar Periwal |
2006-12-31 15:26:29 |
Does HXTT Excel JDBC driver support all database metadata calls (for example, metadata.getTables() or metadata.getColumns())?
|
Re:Support for metadata calls in HXTT Excel JDBC driver |
Damodar Periwal |
2006-12-31 15:27:18 |
Does HXTT Excel JDBC driver support all database metadata calls (for example, metadata.getTables() or metadata.getColumns())?
|
Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
HXTT Support |
2006-12-31 18:19:23 |
Yeah.
|
Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
Damodar Periwal |
2007-01-17 19:14:44 |
My worksheet has three columns - name, age, and weight. There is one row of data with values (Harry, 45, 130.7). I tried using the getColumns() call on this worksheet with your driver, as follows:
ResultSet columns = dbMetaData.getColumns(null, schema, tableName, "%");
column = new ColumnInfo(
columns.getString(4/*"COLUMN_NAME"*/),
columns.getShort(5/*"DATA_TYPE"*/),
columns.getString(6/*"TYPE_NAME"*/),
columns.getInt(7/*"COLUMN_SIZE"*/), // PRECISION
columns.getInt(9/*"DECIMAL_DIGITS"*/), // SCALE
columns.getInt(17/*ORDINAL_POSITION*/)
);
For DATA_TYPE, TYPE_NAME, and PRECISION, I am getting the values of 2000, JAVA_OBJECT, and 4 respectively for each of the three columns (name, age, and weight). Is that the expected result? How can we get more appropriate data types, for example, java.sql.Types.INTEGER for an integer columnn, and java.sql.Types.CHAR for a string column, etc.?
Thanks,
-- Damodar
|
Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
HXTT Support |
2007-01-24 20:57:14 |
>Is that the expected result?
Yeah. HXTT Excel accepts all data types( int, char, double, date, timestamp, and so on), so it uses java_object as date type.
>How can we get more appropriate data types, for example,
> java.sql.Types.INTEGER for an integer columnn, and java.sql.Types.CHAR for a
> string column, etc.?
You need to check the data rows. If ResultSet.getObject() returns java.lang.Integer, java.sql.Date, java.lang.String, ..., you can know it's possible int, date, or char.
|
Re:Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
Damodar Periwal |
2007-02-05 16:48:57 |
>Yeah. HXTT Excel accepts all data types( int, char, double, date, timestamp, and so on), so it uses java_object as date type.
But as per the following documentation about the DatabaseMetaData
.getColumns() method:
http://java.sun.com/j2se/1.3/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)
the DATA_TYPE parameter of the resultset is supposed to return the SQL type from java.sql.Types. However, the java_object value returned by HXXT Excel implementation is some fixed value no matter what the actual data type for the underlying column is. As per the specification, the data type should be something like java.sql.Types.INTEGER, java.sql.Types.FLOAT, java.sql.Types.CHAR, etc. So your implementation of the getColumns() method does not seem to be compliant to the JDBC standard specification. Do you agree?
Thanks,
-- Damodar
|
Re:Re:Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
Damodar Periwal |
2007-02-05 16:52:58 |
>However, the java_object value returned by HXXT Excel implementation
I meant the fixed value of 2000
|
Re:Re:Re:Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
denis |
2007-03-26 12:07:42 |
Hello,
I have the same problem,
Have you find a solution?
Thanks for your help,
Oliver
|
Re:Re:Re:Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
denis |
2007-03-26 14:09:00 |
Hello,
I have the same problem,
Have you find a solution?
Thanks for your help,
Oliver
|
Re:Re:Re:Re:Re:Re:Re:Re:Support for metadata calls in HXTT Excel JDBC driver |
HXTT Support |
2007-03-27 01:13:35 |
Denis,
v1.1.010 provides maxScanRows connection property for data auto data type detection, but it still supports using different data types for a column. You should be using an older package.
|
|
|