• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Castor JDO  RSS feed

suresh sampath kumar
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

For the first time iam trying to use Castor JDO for accessing database, i just tryed with a small example, but iam facing some problem which are as follows

This is the bean iam using in my example

public class Shop {
private String id;
private String _Name;
private String _Address;

public String getId() {
return id;
public void setId(String _id) {
this.id = _id;
public String get_Name() {
return _Name;
public void set_Name(String _Name) {
this._Name = _Name;
public String get_Address() {
return _Address;
public void set_Address(String _Address) {
this._Address = _Address;

My Mapping file contains

<database name="ora" engine="oracle">
<driver class-name="oracle.jdbc.driver.OracleDriver" url="******">
<param name="user" value="****" />
<param name="password" value="****" />
<mapping href="mapping.xml" />
<transaction-demarcation mode="local" /> //Step1

My Test Class
import org.exolab.castor.jdo.Database;
import org.exolab.castor.jdo.JDOManager;

public class Shoptest {

public static void main(String[] args) {
Shop _shop = new Shop();
// load database config
try {
JDOManager jdo;
jdo = JDOManager.createInstance("ora");
Database db = jdo.getDatabase();

Intially i was not using the step1(commented (refer above code)) in my Mapping.xml, i wast getting NullPointer exception, then i introduced the Step1(commented(refer above))

iam getting...
"org.exolab.castor.mapping.MappingException: Can not load class oracle.jdbc.driver.OracleDriver"

I will be really greatfull if any one can help me.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!