Try following code in your .jsp file:

InitialContext ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup("jdbc/Oracle");
Connection conn = ds.getConnection();

Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM dual");

while( rs.next() ){
        out.println( rs.getString(1) + "<br>" );
}

conn.close();


with best wishes,
Taavi

> Thanks everybody for helping me with this problems. It works now! 
> However, I
> could not have the jsp example code work!


Reply via email to