Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

JDBC-ODBC exception

Posted on 2005-05-09
11
Medium Priority
?
1,525 Views
Last Modified: 2010-07-27
I have the following configuration:
driver=sun.jdbc.odbc.JdbcOdbcDriver
url=jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\projects\test\mdb\testsite.mdb

When trying to execute the following query:
select this_.id as id0_, this_.channel as channel0_, this_.indxDate as indxDate0_, this_.indxVal as indxVal27_0_ from utindex this_ where this_.id=? and this_.channel=? order by this_.indxDate desc

I get this exception:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented
      at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
      at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
      at sun.jdbc.odbc.JdbcOdbc.SQLGetStmtOption(JdbcOdbc.java:4417)
      at sun.jdbc.odbc.JdbcOdbcStatement.getStmtOption(JdbcOdbcStatement.java:1208)
      at sun.jdbc.odbc.JdbcOdbcStatement.getQueryTimeout(JdbcOdbcStatement.java:697)
... <some Hibernate code> ...
PMac  WARN [09-05-2005 14:39:05] JDBCExceptionReporter - SQL Error: 39, SQLState: 22005
PMac ERROR [09-05-2005 14:39:05] JDBCExceptionReporter - [Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification on column number 3 (indxDate0_)

But when I execute the same query in Access it works.

What can be the problem? It's quite plain query so driver should support this.

Rgds, Ales
0
Comment
Question by:drjustin
  • 6
  • 3
  • 2
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 13958946
Try changing those rather wacky aliases to something shorter, without underscores ;-)
0
 
LVL 3

Author Comment

by:drjustin
ID: 13958967
I use Hibernate, so it generates all the aliases.
Is then the problem of driver not supporting underscores?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13958988
>>Is then the problem of driver not supporting underscores?

Not sure. I was just suggesting that as an experiment. I think it's probably pushing it using Hibernate with Access, but another experiment may be to define a DSN rather than operate with that file url
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Author Comment

by:drjustin
ID: 13959015
First, where do I create DNS in Win XP?
Second, how does then url look like?

0
 
LVL 37

Accepted Solution

by:
zzynx earned 2000 total points
ID: 13959039
Maybe helpful:

>> Invalid character value for cast specification
an SQL statement that contained a literal or parameter and the value was incompatible with the data type of the associated table column.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13959054
>> First, where do I create DNS in Win XP?

Control Panel | Administrative Tools | Data Sources (ODBC)

You'll need to be an administrator. Not saying this will make a difference ;-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13959059
You'll do well to get a proper database though.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13959175
? I don't understand...
0
 
LVL 3

Author Comment

by:drjustin
ID: 13959237
That was the error - wrong mapping type.
Insted of date type there was string type in mdb.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13959249
ok
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13959265
Thanks for accepting
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 9 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question