The Artima Developer Community
Sponsored Link

Java Answers Forum
accessing database through jsp

1 reply on 1 page. Most recent reply: Mar 29, 2002 8:02 AM by Jay Kandy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
patrick

Posts: 23
Nickname: patrick
Registered: Mar, 2002

accessing database through jsp Posted: Mar 29, 2002 7:43 AM
Reply to this message Reply
Advertisement
hi
i have MySQL database tomcat server and the two are on linux
what do i have to do to access my database from jsp pages
i read that i need a jdbc
what jdbc do i need and can can configure it in the tomcat
further in the js pages how can i do my connection in a very detailed way?
thank you


Jay Kandy

Posts: 77
Nickname: jay
Registered: Mar, 2002

Re: accessing database through jsp Posted: Mar 29, 2002 8:02 AM
Reply to this message Reply
Hmmmm. You need a driver driver that can connect to MySQL and speak to a Java program as well. So find a driver (I never used MySQL so I can not suggest in this aspect) on the web download it (with documentation on how to use it).

You will most probably get a jar file (or a zip file that contains jar file(s) ). Place it/them in TOMCAT_HOME/lib

In your bean class do some thign like:
Class.forName("com.driver.class");
connection = DriverManager.getConnection( "url to database;database=;user=;password=");
cs = connection.createStatement()


oh boy use a tutorial :)

Flat View: This topic has 1 reply on 1 page
Topic: session.invalidate Previous Topic   Next Topic Topic: need help on applet

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use