Troubles with JDBC-ODBC, DSN-less connection strings, and 64-bit Windows 7 -



Troubles with JDBC-ODBC, DSN-less connection strings, and 64-bit Windows 7 -

i'm dealing issue has arisen application i've been working on connects access file via jdbc-odbc. on other windows platforms, issue hasn't been encountered, on windows 7 64-bit boxes, attempting connect dsn-less connection strings return:

java.sql.sqlexception: [microsoft][odbc driver manager] info source name not found , no default driver specified

multiple variations on string have been attempted, of them have returned same error. here's how tries connect:

class.forname("sun.jdbc.odbc.jdbcodbcdriver"); stringbuffer databaseconnectionstring; if (systemutils.is_os_windows_7) { databaseconnectionstring = new stringbuffer("jdbc:odbc:driver=microsoft access driver (*.mdb, *.accdb);dbq="); databaseconnectionstring.append(databasefile); } else { databaseconnectionstring = new stringbuffer("jdbc:odbc:driver={microsoft access driver (*.mdb)};dbq="); databaseconnectionstring.append(databasefile); databaseconnectionstring.append(";driverid=22;readonly=false}"); }

examining driver in 32-bit odbc info source admin confirms drivers present. however, when regedt32.exe used examine odbc drivers (hkey_local_machine/software/odbc/odbcinst.ini/odbc drivers), none of them appear.

can help shed lite on this?

i found problem was running programme in 64-bit java. although have yet have programme observe if it's running in 32-bit or 64-bit java, have solved solution installing 32-bit java runtime environment , using .bat file reads follows:

@echo off "c:\program files (x86)\java\jre6\bin\java" -d32 -xmx1024m -jar programname.jar

thanks help!

odbc windows-7-x64 dsn jdbc-odbc

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -