GeeCON Prague 2014*
The moose likes Tomcat and the fly likes Accessing MS ACCESS [Tomcat SERVER] Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Accessing MS ACCESS [Tomcat SERVER] Problem" Watch "Accessing MS ACCESS [Tomcat SERVER] Problem" New topic
Author

Accessing MS ACCESS [Tomcat SERVER] Problem

Mani kan
Greenhorn

Joined: Oct 11, 2010
Posts: 20
Hi,

Actually am creating database web application..i can access the ms access datas when normally am calling an application..once i deploy the WAR file into Tomcat server ..i cannot access the database...


please give me a solution for this issue..


Here my Code:


Soumyajit Hazra
Ranch Hand

Joined: Jun 26, 2007
Posts: 136
What error or exception are you getting exactly?
Please follow the steps first
1. Check if the "user" DSN is created and pointed to the proper .mdb file
2. Check the tomcat console for any exception
3. Print the Connection object . You should not get null if connection is established.


Java Programmer | SCJP 1.5 | SCWCD 1.4
Mani kan
Greenhorn

Joined: Oct 11, 2010
Posts: 20
yeah here connection is not establishing! what i have to do to get rid of this problem? but access path and dsn creation are perfect ?
Soumyajit Hazra
Ranch Hand

Joined: Jun 26, 2007
Posts: 136
but access path and dsn creation are perfect ?

Please state properly what are the steps you followed to create the DSN. Typically
1. Goto start and control panel. Select administrative tools.
2. In that select DataSources (ODBC).
3. Click on the right side pane.
4. Select the driver as Driver do Microsoft access(*.MDB)
5. Click finish.
6. Goto select and find the databse name on the drive. Select the location.
7. Give Dsn name. Click on ok.
8. Find the Dsn name added to the list.
9. You are done.
above are the steps. Did you ran your java code out of tomcat (not as web app) and still getting same problem? What exception are you getting?
Mani kan
Greenhorn

Joined: Oct 11, 2010
Posts: 20
no no..normally i can establish the connection after deploying my web app to tomcat server..i cannot create the connection ..thats the problem in my application...


what issue it might be?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

Actually, you really shouldn't be using MS Access with any webserver. It's not safe to use in a multi-threaded environment, and that's just about every web server, and definitely Tomcat.

You should use a database server that runs as a stand-alone application. Popular ones include MySQL, PostgreSQL, Apache Derby, SQLite, IBM DB2, Oracle and others. All the ones listed up to (but not including) DB2 are free open-source products. The others are available in "express" versions for free or as commercial products.

Oh. Forgot one. As long as you're running Windows - and only Windows, there's a version of SQL Server available for free as well. My experience has been that it's better to use the SourceForge JDBC drivers instead of Microsoft's drivers. The MS-supplied drivers were giving me problems on stuff where someone had gone insane on nested transactional stored procedures.


Customer surveys are for companies who didn't pay proper attention to begin with.
rohithsrivardhan reballi
Greenhorn

Joined: Jun 23, 2013
Posts: 1
Soumyajit Hazra wrote:
but access path and dsn creation are perfect ?

Please state properly what are the steps you followed to create the DSN. Typically
1. Goto start and control panel. Select administrative tools.
2. In that select DataSources (ODBC).
3. Click on the right side pane.
4. Select the driver as Driver do Microsoft access(*.MDB)
5. Click finish.
6. Goto select and find the databse name on the drive. Select the location.
7. Give Dsn name. Click on ok.
8. Find the Dsn name added to the list.
9. You are done.
above are the steps. Did you ran your java code out of tomcat (not as web app) and still getting same problem? What exception are you getting?

It throws data not found exception
 
GeeCON Prague 2014
 
subject: Accessing MS ACCESS [Tomcat SERVER] Problem