This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes pls help me deal with jsp--oracle database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSP
Reply locked New topic

pls help me deal with jsp--oracle database connection

amanda wu

Joined: Mar 16, 2003
Posts: 25
please help me,
my code below connect to an oracle database.
but the code never print out data in database,
but the line"not ok".
i have checked many times, and don't know the reason.
is it due to the code or i put the driver in wrong place?
where should i put the oracle driver then?
i would appreciate your help very much if u can figure it out for me
<html><head><title>test db</title></head>
<%@ page import="java.sql.*"%>
<table border =1 width ="75%">
Connection conn=null;
Statement st=null;
ResultSet rs=null;
String dbURL="jdbc racle:thin:@ btest";
String username="igdnet";
String password="igdnet";
conn = DriverManager.getConnection(dbURL,username,password);
rs=st.executeQuery("Select * from T_Session_Logs;");

catch (Exception e){
not ok:
if (rs!=null)rs.close();
if (st!=null)st.close();
if (conn!=null) conn.close();

Joined: Mar 20, 2003
Posts: 13
U can try with
rs=st.executeQuery("Select * from T_Session_Logs");
It may help.
Probably, query should wrong..........
if it does not help then print the exception
amanda wu

Joined: Mar 16, 2003
Posts: 25
thank you very much,
finally i made it run
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
Hi, seek help and Funny Tell

Welcome to JavaRanch! Please adjust your display names to meet the JavaRanch Naming Policy.
You can change it here.


"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: pls help me deal with jsp--oracle database connection
It's not a secret anymore!