aspose file tools*
The moose likes JDBC and the fly likes Java JAR connecting to DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Java JAR connecting to DB" Watch "Java JAR connecting to DB" New topic
Author

Java JAR connecting to DB

Rich Vicary
Greenhorn

Joined: Jul 09, 2011
Posts: 2
Hi all,

I've inherited a system whereby a JAVA JAR file connects to a local database. This works absolutely fine on Win x86 but we're unable to get working on any Win x64.

When running the batch file(text below) I get presented with the error message "Database Access fails! Mure sure 'database.mdb' is in your local path. [Microsoft][ODBS Driver Manager] Data source name not found and no default driver specified"

I've had a look in ODBC sources but I don't have to add anything for Win x86 so have no idea of what to enter for x64.

I've read a few things about different drivers for x64 but have had no luck with any fixes suggested. I've tried adding the program and DB path to the path of windows environmet but still nothing.

I'm a total newb when it comes to this and have no experience at all so i'm hoping someone has come across this before and has an easy solution!

The batch file we run is as follows:

@echo off

set JAVA_HOME=c:\program files\java\jreVERSION_NUMBER\bin

set DATATBASE_DIR=lib
set PATH=%DATABASE_DIR%;%JAVA_HOME%;%PATH%
start "" javaw -jar lib/database.jar

Apologies if this is not in the right place.

Thanks

Rich
Madhan Sundararajan Devaki
Ranch Hand

Joined: Mar 18, 2011
Posts: 312

As you have suspected, you need to use a driver compatible with 64-Bit JVM. Also, you need to create a DSN to use the MS-ACCESS database in your application.


S.D. MADHAN
Not many get the right opportunity !
Rich Vicary
Greenhorn

Joined: Jul 09, 2011
Posts: 2
Madhan Sundararajan Devaki wrote:As you have suspected, you need to use a driver compatible with 64-Bit JVM. Also, you need to create a DSN to use the MS-ACCESS database in your application.


Do you have any guidance / advice on how to do this, and what is best to use; everything I have tried has so far failed?

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java JAR connecting to DB