Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 27th, 2000, 02:26 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
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
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #2  
Old March 30th, 2000, 02:27 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
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

Reply With Quote
  #3  
Old March 31st, 2000, 03:19 AM
seshan seshan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 1 seshan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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.
Comments on this post
BaronVonDoppleG agrees!

Reply With Quote
  #4  
Old April 12th, 2000, 12:14 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
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


Reply With Quote
  #5  
Old April 12th, 2000, 03:44 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Solaris-Apache-JServ-MySQL question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap