try
{
String temp = null;
Class.forName("........"); // fill ( ) with your conifig...
Connection conn = DriverManager.getConnection(" ...... ");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from Countries");
while (rs.next())
{
temp = rs.getString(2);
%>
<%= temp %>
<%
}
}
catch (Exception e)
{
e.printStackTrace();
}
reference this code. :-)
----- Original Message -----
From: "Henki Lubis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 21, 2000 1:10 PM
Subject: How to conect to database ???
> Hi .. guys .. i am learning how to get data from a database and show it up
> into my web page..
> Let say i have a table called Countries and has 2 fields called CountryID
> and CountryName ..how can i get the value of CountryNAME and show it up into
> my page ?? let say i have an input type="text" ...
>
> I really apreciate for your help ..
>
> A beginner from Indonesia
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets