Thank you fro the reply,
I just read the tutorial and try to run the example,
like the example on
http://www.hibernate.org/hib_docs/v3/re ... orial.html
package events;
[code]import org.hibernate.Session;
import java.util.Date;
import util.HibernateUtil;
public class EventManager {
[b]public static void main(String[] args) {
EventManager mgr = new EventManager();
if (args[0].equals("store")) {
mgr.createAndStoreEvent("My Event", new Date());
}
HibernateUtil.getSessionFactory().close();
}[/b]
private void createAndStoreEvent(String title, Date theDate) {
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
Event theEvent = new Event();
theEvent.setTitle(title);
theEvent.setDate(theDate);
session.save(theEvent);
session.getTransaction().commit();
}
}[/code]
i don't understand the code in bode
what they try to do on this few lins of code??
if (args[0].equals("store")) {
mgr.createAndStoreEvent("My Event", new Date());
}
and it also couse out of index error.
what is wrong?