Use the jsp:include directive. Something like this:
<jsp:include page="/servlet/<Packagename.ClassfileName" flush="true"/>
RS
Mario Henley Becerril Geldis <[EMAIL PROTECTED]> on 07/22/2002 10:21:45 AM
Please respond to "Tomcat Users List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc:
Subject: Run class on jsp
I am a beginner on JSP enviroment..
I have a class file, this connect a Oracle database, and query to single
table...now i want run this class on a jsp page...how i do it..??
my code:
import java.sql.*;
import java.io.*;
import java.util.Date;
class JdbcTest
{
public static void main (String args [])
throws SQLException, IOException
{
System.out.println ("Loading Oracle driver");
try
{
Class.forName ("oracle.jdbc.driver.OracleDriver");
}
catch (/*ClassNotFound*/ Exception e)
{
System.out.println ("Could not load the driver");
e.printStackTrace ();
}
System.out.println ("Connecting to the remote database");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@(DESCRIPT
ION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.4)(PORT =
1521)
))(CONNECT_DATA =(SERVICE_NAME = votoedos)(SRVR =
DEDICATED)))","scott","enie");
System.out.println ("OK");
Statement stmt = conn.createStatement ();
// Query the employee names
ResultSet rset = stmt.executeQuery ("SELECT dttofed From
TDFDF97_NL");
while (rset.next ())
{
// Print the name out
System.out.println (rset.getString (1));
}
}
}
--
To unsubscribe, e-mail: <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>