aspose file tools*
The moose likes JSP and the fly likes Problems accessing MS Access using Tomcat and JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problems accessing MS Access using Tomcat and JSPs" Watch "Problems accessing MS Access using Tomcat and JSPs" New topic
Author

Problems accessing MS Access using Tomcat and JSPs

Dan Brit
Greenhorn

Joined: Oct 07, 2011
Posts: 3
I am currently studying a computer science course at university and one of the modules is teaching about Web Development using JSPs. This post is NOT concerning a coursework assignment although I would expect the issue I have will no doubt be the same when the coursework is eventually released. The problem I am having crops up ONLY when accessing the database which is unfortunately MS Access. We are using Tomcat for all our tasks.

When I try to load a page from examples given be the lecturer I get the error:-

HTTP Status 500 - An exception occurred processing JSP page /connection.jsp at line 3



For this page to load it is assumed the path specified is correct. I have checked, rechecked, and more. The path is absolutely correct for running on the laptop I am using. I have however tried many options. I have even put Tomcat on my C drive and renamed it to mywebserver to make it fit the path that is there in the original example: c:/mywebserver/webapps/db_examples/orders.mdb

All the JSPs that DON'T involve accessing the database work. I am guessing there must be something else on line 3 of this JSP causing the issue. I am hoping someone can help me understand what needs changing. I am pretty good with understanding most programming but am not yet familiar with the classes used for these tasks. I am pretty sure I need a JDBC driver and that the code in this JSP sets this up, but I am not understanding why all the pages that access the database will not work.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
The JDBC driver you are using is the standard ODBC-JDBC bridge which comes with Java.

However you WILL need an ODBC driver for MSAccess.
Have you got MS Access installed on this laptop? Or an ODBC driver for it?

One thing you can check is in the windows control panels:
Control Panel --> Administrative Tools --> Data Sources (ODBC)

Click on the Drivers tab, and it should tell you what ODBC drivers you have on your system.

Dan Brit
Greenhorn

Joined: Oct 07, 2011
Posts: 3
I have attached screenshots of the ODBC info which I think you are pointing me towards. I do have MS Access installed on this laptop.

I just googled access ODBC and installed drivers from Microsoft site but I still am getting the same problem.



[Thumbnail for ODBC_info.JPG]

[Thumbnail for ODBC_drivers.JPG]

Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Its been years since I last used MS Access with java. One thing that does trigger my memory - make sure it is there in System DSN, not just user DSN.

Dan Brit
Greenhorn

Joined: Oct 07, 2011
Posts: 3
This problem is driving my absolutely nuts. I am wanting to get on with the programming problems but find there is this issue where I need something installed and configured beforehand.

I know this will not be a first for this issue. Does anyone know of a step by step tutorial to fix this so that the proper ODBC drivers are working and that when a JSP wants information from the MS Access database it doesn't give the error in the first post or this one:-

HTTP Status 500 - javax.servlet.ServletException: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
 
jQuery in Action, 2nd edition
 
subject: Problems accessing MS Access using Tomcat and JSPs