The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
Solaris-Apache-JServ-MySQL question
Discuss Solaris-Apache-JServ-MySQL question in the Java Help forum on Dev Shed. Solaris-Apache-JServ-MySQL question Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 27th, 2000, 02:26 PM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47

Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
I've gotten JServ installed with Apache on a Unix box and I've been playing around with some servlets. Now I want to tie in to some MySQL and Oracle databases. I've already got PHP accessing the MySQL databases without JDBC. Is there a ./configure option to add support for MySQL or Oracle when building JServ? Or do I need a JDBC driver on my Unix box to make it work. If so can someone recommend a JDBC driver for Solaris?
I need of a clue,
Robman
|

March 30th, 2000, 02:27 PM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47

Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
OK I've got everything working just not all working together. I've installed the MM.MySQL JDBC driver and I can get to the MySQL database from the command line by running "java servletname" but my servlet tells me it couldn't connect to the database when I run it from the browser. It's giving me the "No Suitable Driver" error which apparently means that the driver isn't being loaded.
Hold on there's a tutorial here at Devshed that looks like it may have what I need.
Robman
|

March 31st, 2000, 03:19 AM
|
|
Junior Member
|
|
Join Date: Mar 2000
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Move the mm.Mysql drivers to classes directory of Apache Jserv or add the path in zope.properties file.
I've a different problem, whenever I post details from a form thru servlets into Mysql database, the data goes in as Null. The solution I got is to use Prepared Statement of Java. I've tried that but in vain. If any one has an example of data being posted into Mysql database using servlets please share it with me.
Thanx.
Seshan.
|

April 12th, 2000, 12:14 PM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47

Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
Thanks Seshan,
I added the directories to the CLASSPATH in the jserv.properties file and I've since got the driver loading but I still cannot get a connection. Are you saying I need to add the CLASSPATH in the zone.properties file as well?
Here is a more detailed description of the situation as I posted on Sun's Java discussion list.
"This is my setup/configuration:
Sun UltraSparc 2
Solaris 7
Apache 1.3.12 with JServ
ApacheJserv 1.1
JSDK2.0
java1.2
jdk1.2.2 mm.mysql.jdbc-1.2c (was using b but just switched thinking maybe it would fix it)
I'm fairly new to Java and servlets. So I've been working with some of the demo apps and servlets available from Sun, here and other sites on the net. Applications seem to load the driver and connect with no problems but servlets either don't load the driver (I've checked for it with a DriverManager.getDrivers() call and then iterate through the enumeration) or the connection is null. The driver is loaded on the first instantiation (call to the servlet) but if I refresh the browser it disappears. Isn't it supposed to persist once loaded? At first I didn't RTFM so I hadn't put the driver directory in the jserv.properties file. Once I did that the driver started showing up but the connection is always null. I've also tried putting my servers IP number in instead of localhost but then apache returned an internal server error problem. Seems to work sortof with localhost or *."
I've since determined that the driver is staying loaded but the connection isn't connecting.
Robman
|

April 12th, 2000, 03:44 PM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47

Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
OK I figured it out. The example I was using showed something like:
Connection dbConn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db_name?username=nobody");
so that was what I put in. What it should be is
Connection dbConn = DriverManager.getConnection("jdbc:mysql://localhost:3306/error_report?nobody");
Could have sworn I tried that but perhaps had something else wrong somewhere. Or perhaps the network gods smiled upon me. Anyway I'm off and running. Extracting data but will soon be trying to post data to the database.
More to follow or perhaps we should start a new thread on posting data into mysql.
Robman.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|