put it in a
try
{
your db stuff
}
catch(Exception e)
{
your error message
}
----- Original Message -----
From: "Bert" <[EMAIL PROTECTED]>
To: "JRun-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, August 02, 2001 6:11 PM
Subject: Re: Querying the Db
> Thanks If I wanted to process or query the db via a form from the previous
> page would I use the similar concept?
>
>
>
>
> Bert
>
>
>
> ----- Original Message -----
> From: "Gunter Sammet" <[EMAIL PROTECTED]>
> To: "JRun-Talk" <[EMAIL PROTECTED]>
> Sent: Thursday, August 02, 2001 7:50 PM
> Subject: RE: Querying the Db
>
>
> > Here a sample for a jsp page connecting to a DB:
> >
> > <html>
> > <head> <title>Listing the content of a Database</title> </head>
> > <body>
> > <p> Content of the dealer database:
> > <table border=1 cellpadding=0 cellspacing=0>
> > <tr> <td> Shop </td>
> > <td> Street </td>
> > <td> Country </td>
> > <td> ZIP </td>
> > <td> City </td>
> > <td> Phone </td>
> > <td> Fax </td>
> > <td> EMAIL </td>
> > <td> WEB </td>
> > </tr>
> > <%
> > Class.forName("org.gjt.mm.mysql.Driver");
> > java.sql.Connection connection =
> >
>
java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/yourDataba
> > se", "yourUser", "yourPassword");
> > java.sql.Statement statement = connection.createStatement();
> > java.sql.ResultSet columns = statement.executeQuery("SELECT * FROM
> > dealer");
> > while(columns.next()) {
> > String shop = columns.getString("dname");
> > String street = columns.getString("dstreet");
> > String country = columns.getString("dcountry");
> > String zip = columns.getString("dplz");
> > String city = columns.getString("dort");
> > String phone = columns.getString("dphone");
> > String fax = columns.getString("dfax");
> > String email = columns.getString("demail");
> > String web = columns.getString("dweb");
> > %>
> > <tr> <td> <%= shop %> </td>
> > <td> <%= street %> </td>
> > <td> <%= country %> </td>
> > <td> <%= zip %> </td>
> > <td> <%= city %> </td>
> > <td> <%= phone %> </td>
> > <td> <%= fax %> </td>
> > <td> <%= email %> </td>
> > <td> <%= web %> </td>
> > </tr>
> > <% } %>
> > </table>
> > </body>
> > </html>
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Bert
> > Sent: Thursday, August 02, 2001 4:20 PM
> > To: JRun-Talk
> > Subject: Querying the Db
> >
> >
> > Is it possible to Query the db with Jsp like Asp for example,
> >
> > Via the GetQueryString("parametername")
> >
> >
> > myid = someid
> > then do your Sql Statment etc.
> >
> > select * from my table where myid like id?
> >
> >
> > Bert
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists