hi i made an standalone hibernate application using oracle 8i and facing some problem...now i am writting all the details file...
-----------------hibernate.cfg.xml-------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<!-- Oracle8i connection -->
<property name="connection.driver_class">sun.jdbc.odbc.JdbcO dbcDriver</property>
<property name="connection.url">jdbc:odbc:jyoti1</property>
<property name="connection.username">scott</property>
<property name="connection.password">tiger</property>
<property name="dialect">org.hibernate.dialect.OracleDialect </property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<property name="connection.autocommit">true</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>
<mapping resource="User.hbm.xml" />

</session-factory>

</hibernate-configuration>
----------------------User.hbm.xml-------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="User" table="users" >
<id name="user_Id" type="java.lang.Long" column="user_id" >
<generator class="native">
</generator>
</id>
<property name="firstName" type="java.lang.String" column="first_name" length="40" />
<property name="lastName" type="java.lang.String" column="last_name" length="40" />
<property name="age" type="java.lang.Integer" column="age" length="10" />
<property name="email" type="java.lang.String" column="email" length="40" />
</class>

</hibernate-mapping>

----------------------User.java-----------------------
public class User {

private long user_Id = 0 ;
private String firstName = "";
private String lastName = "";
private int age = 0;
private String email = "";
public User()
{
}
public User(long userId,String firstName,String lastName,int age, String email )
{
this.firstName=firstName;
this.lastName=lastName;
this.age=age;
this.email=email;
this.user_Id=userId;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}

public long getUser_Id() {
return user_Id;
}

public void setUser_Id(long l) {
user_Id = l;
}

}
------------------UserManager.java--------------------------------
import org.hibernate.Session;
public class UserManager {
private Session session = null;
public UserManager(Session session) {
if (session == null)
throw new RuntimeException("Invalid session object. Cannot instantiate the UserManager");
this.session = session;
}
public void saveUser(User user) {
session.save(user);
}
public void updateUser(User user) {
session.update(user);
}
public void deleteUser(User user) {
session.delete(user);
}
}
-------------------------------TestClient.java-------------------
import org.hibernate.*;
import org.hibernate.cfg.Configuration;
public class TestClient {
public User buildUser() {
User user = new User();
user.setFirstName("John");
user.setLastName("Elison");
user.setAge(21);
user.setEmail("john@visualbuilder.com");
return user;
}
public Session openSession() {
SessionFactory sessionFactory =
new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.openSession();
return session;
}
public User testSaveUser(UserManager manager) {
User user = buildUser();
manager.saveUser(user);
System.out.println("User saved with ID = " + user.getUser_Id());
return user;
}
public void testUpdateUser(UserManager manager, User user) {
user.setFirstName("Andrew");
manager.updateUser(user);
System.out.println("User updated with ID = " + user.getUser_Id());
}
public void testDeleteUser(UserManager manager, User user) {
manager.deleteUser(user);
System.out.println("User deleted with ID = " + user.getUser_Id());
}
public static void main(String[] args) {
TestClient client = new TestClient();
Session session = client.openSession();
UserManager manager = new UserManager(session);
User user = client.testSaveUser(manager);
client.testUpdateUser(manager, user);
client.testDeleteUser(manager, user);
session.flush();

}

}

----------------These are all my files-----------------
so when i run this application i face the exception like-------
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select hibernate_sequence.nextval from dual
User saved with ID = 1
User updated with ID = 1
User deleted with ID = 1
Hibernate: insert into users (first_name, last_name, age, email, user_id) values (?, ?, ?, ?, ?)

Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not insert: [User]
at org.hibernate.exception.SQLStateConverter.handledN onSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert( SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.conver t(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2267)
at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(En tityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQue ue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(Ac tionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListe ner.performExecutions(AbstractFlushingEventListene r.java:298)
at org.hibernate.event.def.DefaultFlushEventListener. onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.j ava:1000)
at TestClient.main(TestClient.java:40)
Caused by: java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterBigint(Un known Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.setLong(Un known Source)
at org.hibernate.type.LongType.set(LongType.java:42)
at org.hibernate.type.NullableType.nullSafeSet(Nullab leType.java:136)
at org.hibernate.type.NullableType.nullSafeSet(Nullab leType.java:116)
at org.hibernate.persister.entity.AbstractEntityPersi ster.dehydrate(AbstractEntityPersister.java:2008)
at org.hibernate.persister.entity.AbstractEntityPersi ster.insert(AbstractEntityPersister.java:2243)
... 9 more
help me to solve this