Approved: Fortect
Over the past few weeks, some readers have encountered the error that the jdbc driver class oracle.jdbc.driver.oracledriver could not be found. Several factors can cause this problem. Now we will deal with them.
This is my current code and I am getting an error. My classes12.jar
was imported into external jar.
import java.io.IOException;import java.io.PrintWriter;import java.sql.Connection;import java.sql.DriverManager;import java.sql.ResultSet;import java.sql.SQLException;import java.sql statement;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;Public classification LoginAction extends HttpServletConnection connection;Stmt instructions;ResultSet request rs;String = "SELECT * FROM v_urja_login";protected void doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException PrintWriter out corresponds to response.getWriter (); out.println ("Hello"); String u_name = request.getParameter ("uname"); String u_pass = request.getParameter ("upass"); out.println (u_name); out.println (u_pass); Try Class.forName ("oracle.jdbc.driver.OracleDriver"); conn = DriverManager.getConnection ("jdbc: oracle: thin: @localhost: 1521: XE", "urja", "urja"); stmt = conn. createstatement (); rs = stmt.executeQuery (query); catch (sex SQLException) sex.printStackTrace (); Catch (ClassNotFoundException cnf) cnf.printStackTrace ();
Approved: Fortect
Fortect is the world's most popular and effective PC repair tool. It is trusted by millions of people to keep their systems running fast, smooth, and error-free. With its simple user interface and powerful scanning engine, Fortect quickly finds and fixes a broad range of Windows problems - from system instability and security issues to memory management and performance bottlenecks.
java.lang.ClassNotFoundException: oracle.jdbc.driver. Oracle driver at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1714) possibly at org.apache.catalina.loader.WebappClassLoader.loadClass (WebappClassLoader.java:1559) at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:320 java at.lang.Class.forName0 (native method) at java.lang.Class.forName (Class.java:169) via LoginAction.doPost (LoginAction.java:27) Under javax.servlet.http.HttpServlet.service (HttpServlet.java:647) at javax.servlet.http.HttpServlet.service (HttpServlet.java:728) by visiting org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java: 305). found at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:123) World Wide Web at.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:472) org at.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:99) In org.apache.catalina.valves.AccessLogValve.invoke (AccessLogValve.java:931) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:118) Under org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:407) At org.apache.coyote.http11.AbstractHttp11Processor.process (AbstractHttp11Processor.java:1004) Internet at.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process (AbstractProtocol.java:589) Under org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run (JIoEndpoint.java:310) At java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (ThreadPoolExecutor.java:886) via java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:908) during java.lang.Thread.run (Thread.java:619)
14.2k
need March 24, 2013 at 12:59
465
Isn’t That The Exact Answer You Are Looking For? Check Out The Other Pros And Cons Reported By Java Eclipse Jdbc Oracle10g Classnotfoundexception And / Or Ask Your Own Question.
Class.forName ("oracle.jdbc.driver.OracleDriver");
The internet is throwing a ClassNotFoundException
because you did not create a ojdbc14.jar
file in the library of your project folder. or YOU haven’t defined a specific classpath
of the required JAR
answered March 24, 2013 at 13:13
19.8k
The appendix shows the steps given below to add ojdbc14.jar to Eclipse:
decided on March 25, 2013 at 7:46 am
2.702
Run as -> Run configurations. Select -> your server in the type filter text box
Next, add your class12.File container to the Bootstrap Entries section of the classpath and click Apply.
Now run the file for …… It worked for me !!
satisfied Jul 7 ’16 at 18:17
1,732
Speed up your computer's performance now with this simple download.