dragokranjcec Posted April 1, 2014 Share Posted April 1, 2014 I have a database accessed through ODBC driver and JDBC-ODBC Bridge. Date fields from my database map to ODBC type: SQL_TYPE_DATE=91, 10, 0, SQL_NULLABLE=1(this is from MS ODBC Test utility)These date fields are displayed normally in ODBC query tool, e.g. AQT:Name Type Length NullsdatKnj DATE 10 Y But, when I import fields using JDBC-ODBC bridge, date fields get type java.lang.Date, and of course compiler gives error:java.lang.ClassNotFoundException: java.lang.DateIs this a problem in JDBC driver or in JasperReports / iReport? Link to comment Share on other sites More sharing options...
dsrini.open Posted June 11, 2014 Share Posted June 11, 2014 you might have given the field with the type - java.lang.Date - there is no type in java, it is java.util.DateEven, I am trying to have a date field, let me know if you are successfull. Link to comment Share on other sites More sharing options...
dragokranjcec Posted June 12, 2014 Author Share Posted June 12, 2014 No, I did not define field as java.lang.Date. Problem was in ODBC driver.SQL_TYPE_DATE is defined by ODBC standard as 10 character field with format YYYY-MM-DD. My ODBC driver was returning these values as 8 character field (without '-') and JDBC driver was confused and "invented" type java.lang.Date.AQT was smart enough to interpret non-standard date format correctly, but JDBC driver wanted strict standard format. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now