Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Im assuming your mysql is setup to take connections with correct permissions (something like this): CREATE DATABASE mydb; CREATE TABLE mydb.mytbl( #permissions for testing only! The mysql jar file has to be in the classpath of the jsp environment. (You might want to try using resin (www.caucho.com) as its very easy to set up (basically just put the jar in its lib directory then click and play the following code) as your jsp/ servlet engine. Then the following jsp code will work (put it in the doc directory if your using caucho): &alt;html> String sql; public void manageConnection() conn = DriverManager.getConnection(url, id, pass); &alt;p>This excucutes making a connection&alt;/p> &alt;p>This is the result:&alt;/p> &alt;%= rset.getString(1) %> &alt;p>Closing connection&alt;/p> &alt;% _____________________________________________________
Replies: |
Sponsored Links
|