Go Back   Java Programming Forums > Java Standard Edition Programming Help > JDBC & Databases


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2009, 02:41 AM
Junior Member
 

Join Date: Oct 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Entrant is on a distinguished road
Question Database connectivity problem-Oracle

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(RegistrationAct ion.java:58)
org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(Acti onServlet.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:
Java Code
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;
}
}



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 05-10-2009, 09:18 AM
Json's Avatar
Super Moderator
 

Join Date: Jul 2009
Location: Manchester, United Kingdom
Posts: 1,190
Thanks: 57
Thanked 137 Times in 133 Posts
Json will become famous soon enoughJson will become famous soon enoughJson will become famous soon enough

I'm feeling Happy
Default Re: Database connectivity problem-Oracle

Sounds like you're missing oracle.jdbc.pool.OracleDataSource at runtime, place the appropriate jar file in your application server lib folder or include it with your app.

// Json
Reply With Quote
The Following User Says Thank You to Json For This Useful Post:
Entrant (10-10-2009)
  #3 (permalink)  
Old 10-10-2009, 03:02 PM
Junior Member
 

Join Date: Oct 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Entrant is on a distinguished road
Default Re: Database connectivity problem-Oracle

Hi Json,,,,,

Ur knowledge sharing helped me to sort out the problem...

Thanks buddy!!!!!
Reply With Quote
  #4 (permalink)  
Old 11-10-2009, 03:08 PM
Json's Avatar
Super Moderator
 

Join Date: Jul 2009
Location: Manchester, United Kingdom
Posts: 1,190
Thanks: 57
Thanked 137 Times in 133 Posts
Json will become famous soon enoughJson will become famous soon enoughJson will become famous soon enough

I'm feeling Happy
Default Re: Database connectivity problem-Oracle

No worries, glad to help.

// Json
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Similar Threads
Thread Thread Starter Forum Replies Last Post
updating database gurpreetm13 JDBC & Databases 3 09-10-2009 04:43 PM
Oracle brought Sun Fendaril The Cafe 2 21-06-2009 03:48 PM
Desktop Database Application TCoomer JDBC & Databases 2 04-06-2009 08:51 PM
Connecting to Oracle from within Eclipse kairamr Java IDEs 1 12-11-2008 09:16 PM
struts & database for eclipse kirman Java IDEs 2 17-10-2008 12:26 PM


100 most searched terms
Search Cloud
actionlistener actionlistener in java addactionlistener addactionlister adding elements to two dimensional arraylist adding elements to two dimensional arraylist in java arraylist value into hash buffered read two integer value in java create an abstract class called shape with abstract methods+java double to integer in java double to integer java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread main java.lang.outofmemoryerror java heap space in eclipse exception in thread main java.lang.reflect.invocationtargetexception format double java get mouse position java how to convert list to map in java how to format double in java how to format doubles in java how to make a calculator in jframe using jcreator http://www.javaprogrammingforums.com/collections-generics/2688-grade-array-trouble.html http://www.javaprogrammingforums.com/object-oriented-programming/3713-limiting-decimal-places-double.html iphone java java actionlistener java double format java double to int java font attributes java format double java forum java forums java get mouse position java jbutton java program to find dimensions of a room java programming codes using astirisks java programming forums java scanner squaring numbers java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.lang.reflect.invocationtargetexception jbutton actionlistener jtable questions in java jtext bold jxl.read.biff.biffexception: unable to recognize ole stream mean value decimal double java print out five asterisks in a row as the loop programmer forum scanner char transaction using gui and 2 dimensional array code in java two dimensional arraylist in java

All times are GMT. The time now is 09:22 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.