Hi,
I am having licence version of Excel driver
but in that when i am trying to get data types of the columns then its not giving me proper data type, while in your trial version its giving me proper data type
In trial version its giving me data types like:
VARCHAR ,VARCHAR , VARCHAR , VARCHAR , VARCHAR , VARCHAR , DOUBLE , VARCHAR , DOUBLE , DATE
while in your licence version its giving me data types like:
LONGVARCHAR ,LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , LONGVARCHAR , DATE
for the same table
so for both VARCHAR and DOUBLE its giving me data type as LONGVARCHAR
Regards,
Chintan Parikh
|
>so for both VARCHAR and DOUBLE its giving me data type as LONGVARCHAR
For VARCHAR, it has changed the map to LONGVARCHAR, since it can store about 30,000 character.
For DOUBLE, please check your jdbc url, HXTT Excel can detect double data type.
|
Here i am attaching a sample code in which i am getting LONGVARCHAR data type for DOUBLE data type
try
{
Class.forName("com.hxtt.sql.excel.ExcelDriver");
Connection con = DriverManager.getConnection("jdbc:Excel:/C:/Documents and Settings/Chintan/Desktop/Sales.xls");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select * from Sales");
ResultSetMetaData rs_mtdt = rs.getMetaData();
for(int i=0 ; i < rs_mtdt.getColumnCount() ; i++)
{
System.out.print(" "+rs_mtdt.getColumnTypeName(i+1));
System.out.println();
}
}
catch(Exception e)
{
System.out.println("Exception: "+e);
}
and i think this code contains proper jdbc url,
if there is any thing wrong then please let me know.
Regards,
Chintan Parikh
|
Your code hasn't error, but your double column in your sales.xls should has some text value so that HXTT Excel think it's a longvarchar type.
|
As you said there were some text values in double column in my file, and because of that i was getting LONGVARCHAR data type, but now i am facing below problem:
I am having an Excel with 100 records.
In that Excel i am having a column with double data type
In your trial version it gives me data type as DOUBLE but in your licence version its giving me data type as INTEGER
If you want to see that Excel file then i can give you that file for your reference
Regards,
Chintan Parikh
|
Please send us your xls sample.
|
Checked your sample, it will return:
EmployeeName LONGVARCHAR
Country LONGVARCHAR
City LONGVARCHAR
Region LONGVARCHAR
ProductName LONGVARCHAR
CategoryName LONGVARCHAR
SalesAmt INTEGER
Month LONGVARCHAR
Year INTEGER
OrderDate DATE
It seems HXTT Excel work normal. Please recheck.
|
v2.2.084 fix a bug for DOUBLE/DATE data detection since v2.2.043
so i have downloaded that version from your site, but now i am facing another problem.
we have purchased your drivers for both Access and Excel
so when i try to add that jars in my library and try to create connection object for Xls and Mdb files
then its giving me Exception.
First i have added Access jar and after that i have added Excel jar then in this case i got Connection for Mdb files, but it gives me Exception when i try to get connection for Xls files.
Exception is:
Exception in thread "main" java.lang.NoSuchFieldError: km
at com.hxtt.sql.excel.v.(Unknown Source)
at com.hxtt.sql.excel.EmbeddedDriver.connect(Unknown Source)
at com.hxtt.global.SQLState.getConnection(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Hxtt1.main(Hxtt1.java:16)
After that i have added Excel jar and after that i have added Access jar then in this case i got Connection for Xls files, but it gives me Exception when i try to get connection for Mdb files.
Exception is:
Exception in thread "main" java.lang.NoSuchFieldError: kf
at com.hxtt.sql.access.ae.(Unknown Source)
at com.hxtt.sql.access.EmbeddedDriver.connect(Unknown Source)
at com.hxtt.global.SQLState.getConnection(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Hxtt1.main(Hxtt1.java:19)
Where Hxxt1 is name of my java file from which i am trying to create connection.
I am not facing above problem in your trial version
So. please let me know the solution for this.
Regards,
Chintan Parikh
|
>So. please let me know the solution for this.
You should download Access and Excel package again which was released on the same day.
|