Hi,
Progress since then, but still cannot connect to Oracle:
JDEVELOPER 10.1.3 With Oracle 10g express
Cannot see why, I cannot conect to Oracle?????
Thanks
clive
//
error message:
<%
//Using the request object to extract input values of registration page
String title = request.getParameter("title");
String link = request.getParameter("link");
String descp = request.getParameter("descp");
Connection con = null;
try {
//Load the class file for the driver
Class.forName("oracle.jdbc.driverOracleDriver");
//Establish a connection with the ODBC datasource
con =
DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:XE","sa","");
//The prepared statement to insert values in the table at runtime
PreparedStatement st=con.prepareStatement("insert into rsstb (title,
link, descprition) values (?, ?, ?)");
//The statement to insert appropriate values into the registration
table
st.setString(1, title);
st.setString(2, link);
st.setString(3, descp);
st.executeUpdate();
}
finally {
try {
if (con != null) {
// Close the connection
con.close();
}
}
jcsnippets.atspace.com - 23 Jun 2006 16:24 GMT
> Hi,
>
> Progress since then, but still cannot connect to Oracle:
> JDEVELOPER 10.1.3 With Oracle 10g express
>
> Cannot see why, I cannot conect to Oracle?????
Hi Clive,
Check your mail - I have replied to your (other) mail with possible
solutions.
AFAIK, it's because of classpath problems, ie the driver cannot be found.
Please try it again with the correct jars/classpath, and if all else fails
please post the errors you are getting here as well. This way, other people
can jump in and help and/or benefit from a possible solution as well.
Best regards,
JayCee
--
http://jcsnippets.atspace.com/
a collection of source code, tips and tricks
Clive - 24 Jun 2006 16:07 GMT
Hi,
Still getting error!!!
any advice???
Thanks
clive
The classpath is:C:\oraclexe/app/oracle\product\10.2.0\server\jdbc\lib
files are: ojdbc14.jar and ojdbc14_g.jar
<body>
<%
Connection conn = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(
"jdbc:oracle:thin:@127.0.0.1:1521:XE",
"sa",
"");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM RSSTB");
//Print start of table and column headers
out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\"
BORDER=\"1\">");
out.println("<TR><TH>ID</TH><TH>NAME</TH></TR>");
//Loop through results of query.
while(rs.next())
{
out.println("<TR>");
out.println("<TD>" + rs.getString("ID") + "</TD>");
out.println("<TD>" + rs.getString("Title") + "</TD>");
out.println("</TR>");
}
out.println("</TABLE>");
}
catch(SQLException e)
{
out.println("SQLException: " + e.getMessage() + "<BR>");
while((e = e.getNextException()) != null)
out.println(e.getMessage() + "<BR>");
}
catch(ClassNotFoundException e)
{
out.println("ClassNotFoundException: " + e.getMessage() +
"<BR>");
}
finally
{
//Clean up resources, close the connection.
if(conn != null)
{
try
{
conn.close();
}
catch (Exception ignored) {}
}
}
%>
</body>
The error message is:
java.lang.IllegalAccessError: oracle/jdbc/driver/OracleDriverExtension
at oracle.jdbc.driver.OracleDriver.<init>(OracleDriver.java:51)
at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:470)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at _Listtest._jspService(_Listtest.java:47)
[/Listtest.jsp]
at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0)
].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)
at
oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at
oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at
oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at
oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0)
].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
at java.lang.Thread.run(Thread.java:595)