nelson.broat@ma il.cuny.edu (Nelson Broat) wrote in message news:<32159d9d. 0308060756.218f a22e@posting.go ogle.com>...
Hate to be a smart@ss but you missed the model railroading and French
cooking forums. ;)
Hi, I could use some advice. I'm not sure if this is simply a matter
of improperly displaying results that have been returned, or one of
not properly connecting to the database. What follows is a jsp I
threw together to pull data from a table and display it dynamically
within my I.E. browser.
>
Did I include all the neccessary Classpaths? When the first classpath
was included with all of the rest on my second IMPORT statement, I
kept receiving "could not compile" error messages. So I put it in
its own IMPORT statement.
>
Am I issuing the appropriate getConnection method? Thanks for any and
all advice. Appreciate it. Here is the jsp:
>
<%@ page import="com.epi centric.jdbc.*" %>
>
<%@ page import="java.ut il.*,
java.text.*,
java.io.*,
java.net.URL,
com.epicentric. common.*,
java.sql.*"
%>
>
<%@ include file="/include/common.jsp"%>
>
<%@taglib uri="epi-tags" prefix="epi_htm l" %>
<%@taglib uri="module-tags" prefix="mod" %>
<epi_html:contr ollerURL />
<epi_html:check Ticket />
>
<%
>
//instantiate variables
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
>
try {
//Load the JDBC driver
Class.forName(" oracle.jdbc.dri ver.OracleDrive r").newInstance ();
>
//Get the connection getConnection(" oracle driver", "userID",
"password")
con = DriverManager.g etConnection("j dbc:oracle:thin :@dns_name:port number:oracle_i nstancename","u serid","passwor d");
>
stmt = con.createState ment();
>
//sql statements: create, update, query
rs = stmt.executeQue ry("SELECT * FROM DB.DB_RESOURCE WHERE
DB.DB_RESOURCE. CODE = '**'");
>
while (rs.next())
System.out.prin tln(rs.getStrin g(1));
>
rs.close();
stmt.close();
con.close();
}
catch(Exception ex) {
System.out.prin tln("Error " + ex.toString());
>
}
%>
>
Nelson
of improperly displaying results that have been returned, or one of
not properly connecting to the database. What follows is a jsp I
threw together to pull data from a table and display it dynamically
within my I.E. browser.
>
Did I include all the neccessary Classpaths? When the first classpath
was included with all of the rest on my second IMPORT statement, I
kept receiving "could not compile" error messages. So I put it in
its own IMPORT statement.
>
Am I issuing the appropriate getConnection method? Thanks for any and
all advice. Appreciate it. Here is the jsp:
>
<%@ page import="com.epi centric.jdbc.*" %>
>
<%@ page import="java.ut il.*,
java.text.*,
java.io.*,
java.net.URL,
com.epicentric. common.*,
java.sql.*"
%>
>
<%@ include file="/include/common.jsp"%>
>
<%@taglib uri="epi-tags" prefix="epi_htm l" %>
<%@taglib uri="module-tags" prefix="mod" %>
<epi_html:contr ollerURL />
<epi_html:check Ticket />
>
<%
>
//instantiate variables
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
>
try {
//Load the JDBC driver
Class.forName(" oracle.jdbc.dri ver.OracleDrive r").newInstance ();
>
//Get the connection getConnection(" oracle driver", "userID",
"password")
con = DriverManager.g etConnection("j dbc:oracle:thin :@dns_name:port number:oracle_i nstancename","u serid","passwor d");
>
stmt = con.createState ment();
>
//sql statements: create, update, query
rs = stmt.executeQue ry("SELECT * FROM DB.DB_RESOURCE WHERE
DB.DB_RESOURCE. CODE = '**'");
>
while (rs.next())
System.out.prin tln(rs.getStrin g(1));
>
rs.close();
stmt.close();
con.close();
}
catch(Exception ex) {
System.out.prin tln("Error " + ex.toString());
>
}
%>
>
Nelson
cooking forums. ;)
Comment