SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old April 16th, 2004, 03:59 AM
rahim_vindhani rahim_vindhani is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 rahim_vindhani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation how to configure mysql and jdbc?

hi,

i dont know how to configure mysql and jdbc.I have to use jsp and mysql as a databse.
so please tell me as soon as possible

Reply With Quote
  #2  
Old May 23rd, 2004, 01:30 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m
Reputation Power: 5
To connect a java program to a MySQL database, you should download the driver. This driver can be downloaded at http://www.mysql.com. I suppose you're working with Tomcat ? In that case, you should put the downloaded file (jar file for Java ARchive) in Tomcat 4.1\common\lib.
To get connection to the database, you should write
Class.forName("com.mysql.jdbc.Driver").newInstance();
dbconn = DriverManager.getConnection("jdbc:mysql://localhost/gco");

To look things up, write :
StringBuffer searchString = new StringBuffer();

searchString.append(
"select * from mlzro");

PreparedStatement ps = dbconn.prepareStatement(searchString.toString());

ResultSet rs = ps.executeQuery();

With the resultSet rs you can read the records, and place its columns in an object

But frankly, I'd like to give you an advice. Don't use JSP's alone. Use JSP's in combination with servlets and follow the MVC (model view controller). It seems like hard work but it pays off when you want a maintainable and scalable application.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > how to configure mysql and jdbc?


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway