aspose file tools*
The moose likes Tomcat and the fly likes not able to connect a web application  to database server located on same system. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "not able to connect a web application  to database server located on same system. " Watch "not able to connect a web application  to database server located on same system. " New topic
Author

not able to connect a web application to database server located on same system.

dhaval dethe
Greenhorn

Joined: Aug 23, 2011
Posts: 4
I am creating a sample web application using servlet and jsp (mvc) in Eclipse Helios.
I created dynamic web app project.
Application server is Apache Tomcat.

I want to connect to database server locating on same system.
I am using mysql 6.0.
I added mysql jdbc connector jar in my project but still I am getting

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Log In failed: An Exception has occurred! java.lang.NullPointerException

can any one please explain?
Where do I placed connector jar?
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2

Application server is Apache Tomcat.

Tomcat is not an Application Server.


java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

how you are adding jar file in eclipse..?
put your mysql jar file in tomcat->lib folder as well, i solved same problem by putting jar file into lib.
Assuming you are adding jar file like this:
Project->Build Path->Add External jars.

hope it helps..
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Punit Jain wrote:Tomcat is not an Application Server.

There is no generally agreed-upon definition of the term "application server", and Tomcat can easily serve as one. What Tomcat is not is a "JEE server", which is something that actually does have a fixed definition.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 1000
    
    2

There is no generally agreed-upon definition of the term "application server"

i agree.

and Tomcat can easily serve as one.

how although tomcat not supports ejb's.

here
here

although there is no specific definition so we can decide for our self, i think
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Punit Jain wrote:how although tomcat not supports ejb's.

Because an application does not require the use of EJBs. A JEE server would require all JEE APIs to be implemented, including EJB.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16065
    
  21

Ha! I can out-p├Ždant anyone here!

Tomcat is, according to generally-accepted usage, a Web Application Server.

Tomcat is - in a limited scope - a J2EE web application server. It is not, however, a full-stack web application server because it lacks several of the heavyweight capabilities (such as EJB container) that are required to be provided in order to be certifiable. Tomcat only provides the servlet/JSP support, a JNDI server, Database connection pools, security Realms, and a few odds and ends.

Despite Tomcat's limited capabilities, it has served as a prototyping platform for next-generation servlet/JSP designs. It also has been employed as the servlet/JSP subsystem services provider running embedded in full-stack J2EE/JEE web application servers such as JOnAS and JBoss,

----

So much for nit-picking. In Tomcat versions 6 and greater, the database driver JAR must be copied into the TOMCAT_HOME/lib directory. It must NOT be included as part of any application (WAR) because it's used at the container level by the connection pooler(s) and individual application classpaths are not shared as part of the server classpath. The server's classpath is part of the individual webapp classpaths, though.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to connect a web application to database server located on same system.