Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on Database connectivity problem-Oracle within the Java forums, part of the Software Development category; Hello techs, Could anyone help me out to sort the below exception error. Oracle Port: 8080 Tomcat Port : 8088 HTTP Status 500 - type Exception report message description The ...
|
|||||||
|
|||
|
Hello techs,
Could anyone help me out to sort the below exception error. Oracle Port: 8080 Tomcat Port : 8088 HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet execution threw an exception root cause java.lang.NoClassDefFoundError: oracle/jdbc/pool/OracleDataSource db.DAO.getConnection(DAO.java:38) db.DAOQuery.register(DAOQuery.java:113) actions.RegistrationAction.execute(RegistrationAction.java:58) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) 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.9 logs. The below coding might be helpful to resolve. DAO Coding: package db; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.sql.DriverManager; import java.sql.ResultSet; import java.lang.String; import oracle.jdbc.pool.OracleDataSource; import java.sql.*; import java.util.Properties; /** *This class used to establish the connection between JdbcDriver and DataBase. *DataSourceName will be created through URL.Connection will be *created successfully next data will be inserted.Suppose *connection can not be created then Exception occured. * *DriverManager class -- makes a connection with a driver */ public class DAO { public static Connection con = null; public Connection getConnection(String path) { Properties property; try { property = new Properties(); File f=new File(path); FileInputStream filein=new FileInputStream(f); property.load(filein); String systemname = property.getProperty("SYSTEMNAME"); OracleDataSource ods=new OracleDataSource(); ods.setUser("SYSTEM"); ods.setPassword("REDHAT"); ods.setURL("jdbc:oracle:oci:system@"+systemname+":8088/XE"); con=ods.getConnection(); } catch(SQLException e) { System.out.println("1"); e.printStackTrace(); } catch(Exception e) { e.printStackTrace(); } return con; } public boolean returnConnection(Connection conn) { boolean status=true; try { con.close(); } catch(Exception e) { status=false; } return status; } } |
| Sponsored Links |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| JSP database connectivity | Madhulatha Laddika | JSP | 3 | 4 Weeks Ago 07:57 AM |
| Does PHP support all database connectivity? | mca_207 | PHP | 1 | 07-25-2009 11:42 AM |
| AJAX Made Easy - IBM Database Connectivity for JavaScript | Lokesh M | AJAX & XML | 0 | 06-17-2008 03:20 PM |
| database connectivity | anver | SQL Server | 2 | 06-13-2008 06:13 AM |
| I am getting database connectivity error | sumana_i | Test Director | 0 | 04-06-2007 04:24 AM |