aspose file tools*
The moose likes Tomcat and the fly likes Tomcat with MySql and JSP files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat with MySql and JSP files" Watch "Tomcat with MySql and JSP files" New topic
Author

Tomcat with MySql and JSP files

Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
I know you have probably covered this topic a million times, but im new to the site so forgive me if its been answered already.

I have XP Pro on my laptop and have been trying to setup Tomcat and MySql 4.1 and get some JSP files working and displaying what i have in the database!

Basically my problem is how to set it up.

I have downloaded what i think is the latest version of the connector jar file, but i dont know what folders to put it in.

Also everytime I open up MySql it seems to be working on port 3306 and not 8080, is this a problem?

When i read that you have to set up the environmental variables, do i have to do one for Tomcat and also the Java directory!

If there is anything else i need to do or i am doing anything wrong please let me know!

Thanks!

Reuben
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31075
    
232

Reuben,
Welcome to JavaRanch!

The connector jar goes in C:\Tomcat\common\lib.

Tomcat uses port 8080. MySQL itself should use a different port or there would be conflicts.

Yes, you have to set both environment variables: JAVA_HOME and TOMCAT_HOME. They are used for different purposes.

One piece of advice: try to run a simple JSP to verify the Tomcat setup before you try to do anything with JDBC.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Agree with Jeanne -- one step at a time. Get Tomcat up and working for you before anything else. Check out the Tomcat forum if you need help.
[ April 05, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
Thanks Guys, i'll try that! I'll let you know how i get on.
Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
When i installed Tomcat, it automatically put everything into this drive... C:\Program Files\Apache Group\Tomcat 4.1

Should i make a new folder in C: called C:\Tomcat and copy all the contents from C:\Program Files\Apache Group\Tomcat 4.1 into it?
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Reuben Fields:
When i installed Tomcat, it automatically put everything into this drive... C:\Program Files\Apache Group\Tomcat 4.1

Should i make a new folder in C: called C:\Tomcat and copy all the contents from C:\Program Files\Apache Group\Tomcat 4.1 into it?


I think till Tomcat 4.x, it was just copy and paste. From version 5.0 onwards we have a setup/install file.

Its on you, whereever you wanna copy/install tomcat binary.
Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
Where should my default html page be? Is it in C:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT? Because i see there is an index.jsp there after installing Tomcat. Is this where i save the jsp file to test the connection? Thanks again!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Since this has become about Tomcat, moving to that forum.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

You an test yout Tomcat connection without writing any JSP. Once installed and started, hit http://localhost:8080/ and you should see the Tomcat welcome page.

In fact, I would leave the default web app alone and create one of your own. The Tomcat documentation describes how to lay out the folder structure for web applications.
Rahul Singh Khokhar
Ranch Hand

Joined: Feb 23, 2005
Posts: 36
Hi Reuben,
I'll simplify the setup of Tomcat + Mysql for you.

1. Things you need:
a) Tomcat
b) MySQL Server & Client install
c) JVM (JDK and not JRE)
d) MySQL JConnector for JDBC connectivity

2. Things you need to know:
a) Tomcat by default uses port 8080
b) MySQL by default uses posrt 3306
c) Stick to the default settings unless there is a specific need

3. Install JDK first followed by Tomcat

4. Test your Tomcat install by pointing the browser to
http://localhost:8080

5. Install MySQL and test it as follows
<cmd>
c:\> mysql

6. Unzip the MySQLJConnector and put the .jar file into
<Your JAVA>/jre/lib/ext

Thats all you need to set up JSP using MyQSL

Hope this info helps.
Rahul..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat with MySql and JSP files