Help me.Pls...I am a newbie for DB....

Help me.Pls...I am a newbie for DB....

Post by hanct200 » Mon, 21 Apr 2003 19:15:43



I have these following software: jrun 4, mysql, mysql connector/J, and
also have create database and table using mysql.....but the problem is
where am i suppose to install the mysql connector/J into ??

The jsp page below is wat I copied from internet with changes to suit
me...I use mysql to create database called trial and my table in it is
called countryname. but got the class.forName(), is the paramter in the
class.forName() correct???

Do I have to configure anything in the JRUN admin console for this
jsp-database communication to work?

NB:I did not install any webserver..cos if i not wrong, jrun itself has
a webserver within it...or am i wrong? Note that i used jrun to run my
jsp and html successfully...just that i now need to make my jsp read my
database....but i failed.


<%
String connectionURL = "jdbc:mysql://localhost:8888/trial";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%> <html><body>

<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "", ""); //is
this correct ????
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM countryname");

while (rs.next()) {
out.println(rs.getString("countryname")+"
");

Quote:}

rs.close();
%>

</body></html>

Thanks for answering.

--
Posted via http://dbforums.com

 
 
 

Help me.Pls...I am a newbie for DB....

Post by Andy Flower » Fri, 25 Apr 2003 06:44:52


Do you receive any exceptions when you run the JSP ?

In fact does the JSP even compile - I believe you should be catching the
exceptions that may be thrown by the JDBC code.


> I have these following software: jrun 4, mysql, mysql connector/J, and
> also have create database and table using mysql.....but the problem is
> where am i suppose to install the mysql connector/J into ??

> The jsp page below is wat I copied from internet with changes to suit
> me...I use mysql to create database called trial and my table in it is
> called countryname. but got the class.forName(), is the paramter in the
> class.forName() correct???

> Do I have to configure anything in the JRUN admin console for this
> jsp-database communication to work?

> NB:I did not install any webserver..cos if i not wrong, jrun itself has
> a webserver within it...or am i wrong? Note that i used jrun to run my
> jsp and html successfully...just that i now need to make my jsp read my
> database....but i failed.


> <%
> String connectionURL = "jdbc:mysql://localhost:8888/trial";
> Connection connection = null;
> Statement statement = null;
> ResultSet rs = null;
> %> <html><body>

> <%
> Class.forName("com.mysql.jdbc.Driver").newInstance();
> connection = DriverManager.getConnection(connectionURL, "", ""); //is
> this correct ????
> statement = connection.createStatement();
> rs = statement.executeQuery("SELECT * FROM countryname");

> while (rs.next()) {
> out.println(rs.getString("countryname")+"
> ");
> }

> rs.close();
> %>

> </body></html>

> Thanks for answering.

> --
> Posted via http://dbforums.com


 
 
 

Help me.Pls...I am a newbie for DB....

Post by hanct200 » Tue, 29 Apr 2003 20:04:50


but the first and foremost question is where should i install mysql
connector/J (in zip format) into wat folder?

--
Posted via http://dbforums.com

 
 
 

Help me.Pls...I am a newbie for DB....

Post by Andy Flower » Wed, 30 Apr 2003 01:39:35


Zip and Jar files generally go in the WEB-INF\lib directory, which is
automatically added to the containers classpath for the particular web
application


Quote:

> but the first and foremost question is where should i install mysql
> connector/J (in zip format) into wat folder?

> --
> Posted via http://dbforums.com

 
 
 

1. help,help,help,help,help,help,help,help,help,help,help,help,help,

Hi,
I have a small problem, and if you know the answer I would really be
thankful for your help.
I have an access database which is called "Client.mdb"
on a form, I displayed a dbcombox for the costumer's name
a textbox for the address
a textbox for the city
a textbox for the state
and a textbox for the zipcode

on all my textboxes and the dbcombobox I have set their Datasource and
Datafield properties to Data1,
when I run the program the information on the first record of the data shows
on the form,

but what I need to do is, when I change the costumer's name on the
dbcombobox (which displays all of the costumer's names on it) I want the
textboxes to show the address, city, state, and zipcode of the costumer I
have choosen,

Thank you in advance,
Enrique G Lugo

2. sp4 added dt_addUserObject, etc. What are these used for?

3. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

4. SQL3260N An unexpected error occurred when accessing the LDAP directory.

5. query:HELP! HELP HELP HELP HELP

6. Error 1919 Error configuring ODBC database source

7. SQL To ORACLE Help Help Help Help Help

8. Performance drain making all fields text data?

9. HELP HELP HELP HELP!

10. HELP HELP HELP HELP

11. Newbie quetsion...pls help

12. Pls Help: Newbie Question

13. Data replication with Access pls pls help