★ wanayoo — archive 1999 http://www.devshed.com/Talk/Forums/Forum9/HTML/000006.htmlNouvelle recherche | Portail wanayoo
DevShed Menu
* DevShed Home
* Developer News
* DevShed Brain Dump




UBBFriend: Email This Page to Someone!
  DevShed Discussion Forums
  Java Servlets
  Solaris-Apache-JServ-MySQL question

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   Solaris-Apache-JServ-MySQL question
Robman
Member
posted March 27, 2000 01:26 PM     Click Here to See the Profile for Robman   Click Here to Email Robman     Edit/Delete Message Reply w/Quote
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

Robman
Member
posted March 30, 2000 01:27 PM     Click Here to See the Profile for Robman   Click Here to Email Robman     Edit/Delete Message Reply w/Quote
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

seshan
Junior Member
posted March 31, 2000 02:19 AM     Click Here to See the Profile for seshan   Click Here to Email seshan     Edit/Delete Message Reply w/Quote
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.

Robman
Member
posted April 12, 2000 11:14 AM     Click Here to See the Profile for Robman   Click Here to Email Robman     Edit/Delete Message Reply w/Quote
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

Robman
Member
posted April 12, 2000 02:44 PM     Click Here to See the Profile for Robman   Click Here to Email Robman     Edit/Delete Message Reply w/Quote
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.

All times are MST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | DevShed.com

Copyright © 1997-2000 ngenuity. All rights reserved.

Powered by: Ultimate Bulletin Board, Version 5.41a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 1999.