Solved

JSP program not retrieving records from oracle

Posted on 2006-10-20
76
562 Views
Last Modified: 2013-11-23

hi, i made a jsp page which retreieve's some records from a DB.
this is my prog:

______________________
<%@ page session="false" %>
<%@ page import="java.sql.*" %>
<%
try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
out.println("jdbc driver loaded");
}
catch(ClassNotFoundException e)
{
}
%>
<HTML>
<HEAD>
<TITLE>display all users</TITLE>
</HEAD>
<BODY>
<CENTER>
<BR><H2>displaying all users</H2>
<BR>
<BR>
<TABLE>
<TR>
<TH>first name</TH>
<TH>SSN</TH>
</TR>
<%
String s="select fname,ssn"+"from empl";
try
{
Connection c=DriverManager.getConnection("jdbc:odbc:shilpi","scott","tiger");

Statement st=c.createStatement();
ResultSet rs=st.executeQuery(s);
while(rs.next())
{out.println("t2");
out.println("<TR>");
out.println("<TD>" + rs.getString(1) +"</TD>");
out.println("<TD>" + rs.getString(2) +"</TD>");
out.println("</TR>");
}
rs.close();
st.close();
c.close();
}
catch(SQLException e){out.println("t1");}
catch(Exception e){out.println("t12");}
%>
</TABLE>
</CENTER>
</BODY>
</HTML>
------------------------------------------------------------

the table's name is employee
and it contains 2 fields; fname and ssn both varchar2

when i run this jsp file ..
i get this output;

                                displaying all users

                                  first name      SSN

but the records arent displayed ..
i'm using tomcat 5.5
and oracle 9.0.01.
how can i get the records to get displayed?????????

help...
0
Comment
Question by:shilpi84
  • 42
  • 18
  • 10
  • +2
76 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 17773215
Check your logs for exceptions and make sure there are rows found
0
 

Author Comment

by:shilpi84
ID: 17773390
upon debugging i found out that anything after this line:
                          Connection c=DriverManager.getConnection("jdbc:odbc:shilpi","scott","tiger");

is not working ....
why is the connection not getting established?

i checked the services and the following oracle services are runnin:
OracleOraHome90Agent
OracleOraHome90HTTPServer
OracleOraHome90TNSListner
OracleServiceSHILPI

when i posted the query: "SELECT * from empl;" in SQL-PLUS
i got the 4 rows i had entered.

then why is;nt the connection being made?
0
 
LVL 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 480 total points
ID: 17773440
  Hi!

Try this

Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");

Make sure that your Web-App is using classes12.jar.
You can find OracleDriver in classes12.jar (<ORA_HOME>/jdbc).

Check your tnsnames.ora file for <hostname> and <database name>. For example, if you had a following entry in tnsnames.ora file:

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SOMEHOST)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

you would write:

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@SOMEHOST:1521:XE", "scott", "tiger");

Regards,
  Tomas Helgi
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 17773474
To use JDBC:ODBC driver you should write

 // Load the JDBC-ODBC bridge driver
       Class.forName(sun.jdbc.odbc.JdbcOdbcDriver) ;

before createing the connection

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17773488
i checked there . the logs are empty
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 480 total points
ID: 17773499
Here is the JDBC:ODBC guide : http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/bridge.html

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17773534
how can i use classes12.jar??
0
 

Author Comment

by:shilpi84
ID: 17773569
when i did this

Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");


the driver doesnt load anymore........
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 17773577
Make the classes12.jar available through your CLASS_PATH or the web-app lib environment.

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17773644
nothing didnt help i appenend the full path to classes12.jar in the CLASSPATH variable... but still exactly same no output
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 20 total points
ID: 17773658
Put the jar in WEB-INF/lib
0
 

Author Comment

by:shilpi84
ID: 17773663
* appended
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 17773694
How does your tnsnames.ora file look like ?
And how did you write the line below ?
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17773720
nothing .. but the driver gets loaded if i use
     
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c=DriverManager.getConnection("jdbc:odbc:shilpi","scott","tiger");

..
the output never comes up .. i even made a program
and used executeUpdate("CREATE TABLE XYZ(name VARCHAR2(30), ssn INTEGER)";
and insert values by using  sql= "INSERT INTO E VALUES('p','1');
      s.executeUpdate(sql);

in that too only the driver loads and when i extract records using  
sql = "SELECT fname, ssn FROM empl";
      ResultSet rs=st.executeQuery(sql);
<TR>
        <TD><% out.print(rs.getString(1)); %></TD>
</TR>

nothing shows up in the browser..
and i checked by using SQL-PLUS
the TABLE XYZ never got created.
0
 

Author Comment

by:shilpi84
ID: 17773746
from tnsnames.ora:
___________________
SHILPI =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = shilpi1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = shilpi)
    )
  )
___________________________

Connection c = DriverManager.getConnection("jdbc:oracle:thin:@shilpi1:1521:shilpi", "scott", "tiger");
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17773747
You don't want to be using that driver. Did you put classes12.jar in the directory i mentioned?
0
 

Author Comment

by:shilpi84
ID: 17773773
yes yes CEHJ i did i u said but nothing happened
0
 

Author Comment

by:shilpi84
ID: 17773780
:(
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 480 total points
ID: 17773786
Thats because you tell the code to load the JDBCodbc driver before creating the connection which
actually loads the driver and connects to the DB.
Did you try to connect directly to the oracle db by using

Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");

?
IF not try that and if that works then the ODBC setup which you call shilpi is not setup correctly.
Most likely it is there you should look.

Regards,
 Tomas
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 480 total points
ID: 17773813
I recommend that you use the thin client connection to oracle instead of the odbc connection.

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17773872
yes... i did try to connect using this:

Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");


but when i do this the oracle driver doesnt load..
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 17773974
put a try catch statement around the
  Class.forname...
  Connection con...

and print out the error message.
If you get the Driver not found error then the oracle12.jar library
is not in path.

Regards,
  Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17774041
ok
0
 

Author Comment

by:shilpi84
ID: 17774108
ok.. i did what u said Tomas:
__________________________________________________
<%@ page session="false" %>
<%@ page import="java.sql.*" %>
<%
try
{

//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Class.forName("oracle.jdbc.OracleDriver");
out.println("jdbc driver loaded");
}
catch(ClassNotFoundException e)
{
  out.print("driver didnt load.....");
}
%>
<HTML>
<HEAD>
<TITLE>display all users</TITLE>
</HEAD>
<BODY>
<CENTER>
<BR><H2>displaying all users</H2>
<BR>
<BR>
<TABLE>
<TR>
<TH>first name</TH>
<TH>SSN</TH>
</TR>
<%
String s="SELECT fname, ssn FROM empl";
try
{
String url="jdbc:odbc:SHILPI";

//Connection c=DriverManager.getConnection(url,"scott","tiger");
Connection c = DriverManager.getConnection("jdbc:oracle:thin:@shilpi1:1521:SHILPI", "scott", "tiger");

out.print("test line");
Statement st=c.createStatement();
ResultSet rs=st.executeQuery(s);
while(rs.next())
{
out.println("<TR>");
out.println("<TD>" + rs.getString(1) +"</TD>");
out.println("<TD>" + rs.getString(2) +"</TD>");
out.println("</TR>");
}
rs.close();
st.close();
c.close();
}
catch(SQLException e){out.print("this proves an error while establishing a connection");}
//catch(Exception e){e.getMessage();}
%>
</TABLE>
</CENTER>
</BODY>
</HTML>


_______________________________

now this is what my browser displays:
________________________________
\jdbc driver loaded

displaying all users


this proves an error while establishing a connection
first name       SSN
________________________________
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17774122
put the try-catch around the entire jsp, and in the catch do a e.printStackTrace() and then look at your logs to see the exception.
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
ID: 17774168
Print out the e.getMessage() also.

Regards,
  Tomas Helgi
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17774272
Make sure your connection string is correct, and the db is listening on that port
0
 

Author Comment

by:shilpi84
ID: 17774672
how do i check whether oracle is listening to the port or not?

theses are the 4 services whose start-up type is automatic:
OracleOraHome90Agent
OracleOraHome90HTTPServer
OracleOraHome90TNSListner
OracleServiceSHILPI

but the OracleOraHome90Agent automatically stops even if i start it.
and a message pops up : some services automatically stop when not needed
0
 

Author Comment

by:shilpi84
ID: 17774676
ok Tomas i'm trying that try -- catch thing
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17774749
Just move

}catch(Exception e){
    System.err.println("Ex Msg: " + e.getMessage());
     e.printStackStrace();
}

to the very end of the jsp.
0
 

Author Comment

by:shilpi84
ID: 17774981
nothing ... no matter what i do ... i still get the same output.
i made a console program it writes records to the table in the oracle DB, but     ResultSet rs=st.executeQuery(s);
                                                                                                                    while(rs.next())
....
never executes.
both JSP and console Java program can write but not read from the DB.
and the same problem is on my friend's computer which has exactly the same softwares as mine.

i'm suspecting there's something wrong with oracle?
is it possible?
0
 

Author Comment

by:shilpi84
ID: 17774988
i tried jpolin1 it didnt work i dont get an error message
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17774990
probably not something with oracle...is the user you are using setup with permissions to read/write to the table?
0
 

Author Comment

by:shilpi84
ID: 17775462
yes there's only one user on my computer and it has administrative rights
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17775497
you mean on oracle right? Not your windows account or whatever you do to logon to your computer.
0
 

Author Comment

by:shilpi84
ID: 17775614
i meant windows... but when i installed oracle i did set up an account. only one account no other.
0
 

Author Comment

by:shilpi84
ID: 17775623
and i left the password field blank while i was installing
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17775711
bring up your admin console and make sure that user has full privlidges on the table you created.
Remember that access controls can be controlled on a per-table basis.

Sometimes an admin account can create/drop tables but cannot actually modify data in those tables.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 86

Expert Comment

by:CEHJ
ID: 17775726
See if you can use those same credentials in SQLPlus, with the same query
0
 

Author Comment

by:shilpi84
ID: 17775990
>>
>>bring up your admin console and make sure that user has full privlidges on the table you created.
>>Remember that access controls can be controlled on a per-table basis.
>>
>>Sometimes an admin account can create/drop tables but cannot actually modify data in those tables.
>>

jpolin1: how can i bring up the admin console?


>>See if you can use those same credentials in SQLPlus, with the same query
CEHJ: how can i see that??
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17776001
Start SQLPlus and log on with that username and password
0
 

Author Comment

by:shilpi84
ID: 17776050
i used scott, tiger only....
0
 

Author Comment

by:shilpi84
ID: 17776140
i made a console JAVA program just to check whether oracle is running properly and i have full administrative rights.
and it works properly .. it's displaying the records
program
__________________________________________
ok... this is my latest code... and it works!

import java.sql.*;

class A1
{
public static void main(String args[])
{
try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");


Connection c=DriverManager.getConnection("jdbc:odbc:shilpi","scott","tiger");

System.out.println("got connection");

Statement stmt=c.createStatement();

String sq="select fname,ssn from empl";

//stmt.executeUpdate(sq);


ResultSet rs=stmt.executeQuery(sq);
System.out.println("hi");

while(rs.next())
{
System.out.println(rs.getString("fname") +" " +rs.getString("ssn"));
}
rs.close();
stmt.close();
c.close();
}
catch(ClassNotFoundException e1)
{}
catch(SQLException e2)
{}
catch(Exception e3)
{}
}
}
__________________________________________________

if this is working why isnt JSP progream working .... is there a problem with tomcat5.5
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17776155
Don't test it with that driver - you wouldn't use it
0
 

Author Comment

by:shilpi84
ID: 17776318
then which driver should i use?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17776326
The Oracle one
0
 

Author Comment

by:shilpi84
ID: 17776367
what statements do i have to use for it ...
hey CEHJ are you talking about this one?

Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17776410
Yes, use that one
0
 

Author Comment

by:shilpi84
ID: 17776636
i tried that ... the driver doesnt load using Class.forName("oracle.jdbc.OracleDriver");
0
 
LVL 14

Expert Comment

by:hoomanv
ID: 17776727
Do you get any exception ?
What about  oracle.jdbc.driver.OracleDriver
0
 

Author Comment

by:shilpi84
ID: 17777239
no execution when i use oracle.jdbc.driver.OracleDriver
but when using this sun.jdbc.odbc.JdbcOdbcDriver ... only the driver loads
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17777260
>>the driver doesnt load using Class.forName("oracle.jdbc.OracleDriver");

Suggests the jar is not in the classpath
0
 

Author Comment

by:shilpi84
ID: 17778555
ok this is my classpath:
.;C:\Program Files\Java\jdk1.5.0_07\lib\classes;c:\tomcat\common\lib\servlet-api.jar;C:\Tomcat\webapps\abc\WEB-INF\lib\classes12.jar

it is in the classpath but still the driver doesnt load.
0
 

Author Comment

by:shilpi84
ID: 17778601
CEHJ, the oracle driver loaded:) ..
i used this
  Class.forName("oracle.jdbc.OracleDriver");
but the connection is not getting established;
i've put the connection statement:
  Connection c = DriverManager.getConnection("jdbc:oracle:thin:@shilpi1:1521:shilpi", "scott", "tiger");
in a try block.
and it's Exception always gets thrown.
when i put e.printStackTrace() nothing happens.

something weird
this is my catch block for try block of connection stmt.
_________
catch(SQLException e){
    e.printStackTrace();
    //out.print("error in conn.");
}
___________
i commented the "error in conn."
but still whenever i type
http://localhost:8080/abc/e.jsp
i get this output
_________________
jdbc driver loaded

displaying all users


error in conn.
first name       SSN
__________________

i cleared the browser cache tried it in firefox, IE, Opera, restarted tomcat but still the older code gets executed
0
 

Author Comment

by:shilpi84
ID: 17778616
i now copied my e.jsp file and the WEB-INF folder which contains classes\lib\classes12.jar
into a new dir "e" renamed e.jsp to ee.jsp

i now get this error in browser:
____________________________________
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.ee_jsp
      java.net.URLClassLoader$1.run(Unknown Source)
      java.security.AccessController.doPrivileged(Native Method)
      java.net.URLClassLoader.findClass(Unknown Source)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
      org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
      org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
      org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
Apache Tomcat/5.5.20
__________________________________________
0
 

Author Comment

by:shilpi84
ID: 17778650
but when i kept refreshing the page an output came:
____________________________
jdbc driver loaded

displaying all users


first name       SSN
___________________________




i changed the catch block to
___________________

catch(SQLException e){
out.print("connection error");    
e.printStackTrace();
   
}________

and now this is the output:
----------------
no driver loaded

displaying all users


connection error
first name       SSN
_____________

sometimes the driver loads sometimes it doesnt what is that about?

0
 

Author Comment

by:shilpi84
ID: 17778654
i've now lost all hopes ...
it's because of you guys i kept trying with your help for the past 2 days..
i now give up..
i'm switching over to something else... maybe MSAccess.... any suggestions.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17779050
>>maybe MSAccess.

Definitely not. If you have Oracle, then use it. Start by commenting most of the code out to see if the JSP's running
0
 

Author Comment

by:shilpi84
ID: 17781584
i found out i didnt register oracle in ODBC properly
i registered it in the UserDSN instead of the systemDSN

can anyone please tell me what shoul i fill in the following four fields of the DSN configuration:

Data Source Name:
Description:
User Name:
Server:

the tnsnames.ora file's contents are as follows:
__________________
# TNSNAMES.ORA Network Configuration File: D:\oracle\ora90\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

SHILPI =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = shilpi1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = shilpi)
    )
  )

INST1_HTTP =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = shilpi1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = MODOSE)
      (PRESENTATION = http://HRService)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

____________________________
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 480 total points
ID: 17781958
Data Source Name: shilpi
Description: "Something that describes this connection"
User Name: scott
Server: shilpi1

Regards,
   Tomas Helgi
0
 

Author Comment

by:shilpi84
ID: 17782119
it didnt work tomas..
i'm sure there's some problem in setting up the DSN only as this JSP runs on my friends PC(after DSN registration was corrected)

tomas can you please tell me the procedure from scratch.

and when i saw my friend's tnsnames.ora
the host name was "compaq9110" and service name was "xyz"
and he  registered a microsoft oracle driver in the system DSN tab
and these were the configuration settings:
Data Source Name: xyz1
Description:
User Name: scott
Server: xyz

and the classes12.jar was placed in web-inf/lib as you said.

but when i do this on my system with the configuration you told me the connection still doesnt get established
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17782995
You don't need to configure ODBC
0
 

Author Comment

by:shilpi84
ID: 17782997
what do i need to do then?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783002
Just use the correct Oracle driver in its normal mode
0
 

Author Comment

by:shilpi84
ID: 17783013
i m not getting ur point cehj.please elaborate.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783019
Forget Microsoft - all you need is the Oracle driver working in its normal TCP/IP mode. Make sure that you can use all relevant parts of that connection string outside Java before you use them inside it
0
 

Author Comment

by:shilpi84
ID: 17783023
how do i use Oracle Driver?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783029
Just load it with Class.forName
0
 

Author Comment

by:shilpi84
ID: 17783056
ok CEHJ...
i just opened the ODBC from administrative tools and under SYSTEM DSN tab.
i clicked Add>Oracle in OraHome
an Oracle ODBC Driver Configuration dialog opened up.
i put shilpi2 as my DSN and
SHILPI as my TNS Service Name from the drop down list.
and scott as my userID
when i clicked Test Connection
 i got an error dialog box :

_______________________
Unable to connect
SQLState=S1000
[Oracle][ODBC][ORA]ORA-12451: TNS:no listener
______________________

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783110
As i just mentioned, ODBC is unnecessary, will provide greater complexity and inferior performance - leave it alone
0
 

Author Comment

by:shilpi84
ID: 17783140
done.. :)

i just copied the folder containing the JSP page(which was in tomcat/webapps) into D:\oracle\ora90\Apache\Apache\htdocs
and in the browser i typed : http://localhost/we/e2.jsp

..
but when i type http://localhost:8080/we/e2.jsp i iget a file not found(404) error.
this means tomcat problem?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783145
Yes - that's an entirely different question
0
 

Author Comment

by:shilpi84
ID: 17783155
CEHJ reply on this question http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_22031109.html

i'll give u 500...
because you and tomas helgi both helped me solve this and you deserve at least 500.
0
 

Author Comment

by:shilpi84
ID: 17783159
its the same question
0
 

Author Comment

by:shilpi84
ID: 17783336
thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17783403
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countHi challenge 25 84
computer science syllabus 3 52
word0 challenge 4 53
PDFBox - convert image to PDF, PDF resolution 3 69
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now