• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat with MySql and JSP files

 
Reuben Fields
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34870
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Reuben Fields
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys, i'll try that! I'll let you know how i get on.
 
Reuben Fields
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this has become about Tomcat, moving to that forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65128
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic