Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

library

Ads

 
 

Share on Google+Share on Google+

hossein
library
0 Answer(s)      5 years ago
Posted in : Hibernate

strong texthello what jar file need to these?: "import org.hibernate.service.ServiceRegistry;" "import org.hibernate.service.ServiceRegistryBuilder;"

I search internet and I can't find jar file for these

code:

package net.roseindia;

import org.hibernate.Session;

import org.hibernate.SessionFactory;

import org.hibernate.cfg.Configuration;

import org.hibernate.service.ServiceRegistry;

import org.hibernate.service.ServiceRegistryBuilder;

public class ManageStudent {

private static SessionFactory sf;
private static ServiceRegistry serviceRegistry;

@SuppressWarnings("unchecked")
public static void main(String[] args) {
    try {
        Configuration configuration = new Configuration();
        configuration.configure();
        serviceRegistry = new ServiceRegistryBuilder().applySettings(
                configuration.getProperties()).buildServiceRegistry();
        sf = configuration.buildSessionFactory(serviceRegistry);
    } catch (Throwable ex) {
        System.err.println("Failed to create sessionFactory object." + ex);
        throw new ExceptionInInitializerError(ex);
    }

    System.out.println("Hibernate Many to Many Mapping Example Using Annotation ");

    Session session = sf.openSession();
    session.beginTransaction();

    Course c1 = new Course("Cryptography");
    Course c2 = new Course("Java");

    Student s1 = new Student("Sachin Bharadwaj");
    Student s2 = new Student("Vikas Sharma");

    s1.getCourses().add(c1);
    s1.getCourses().add(c2);
    s2.getCourses().add(c2);

    session.save(s1);
    session.save(s2);

    session.getTransaction().commit();
    session.close();
}

}

Ads
View Answers
Ads









Related Tutorials/Questions & Answers:
Library
; } } import java.util.Scanner; public class Library { public static void
library management
library management   i need java script code for library management system with html
Advertisements
library management
library management   i need java script code for library management system with html
library management
library management   i need java script code for library management system with html
library management
library management   i need java script code for library management system with html
native library
native library  how to create native library in java
library system
library system  hi to all..please help me how to make a library system using a java program..please response me
library system
library system  hi to all..please help me how to make a library system using a java program..please response me
netbeans library
for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock in the library 3) Lending an item 4) Returning an item 5) Exiting
netbeans library
for a book library please.The program should provide a menu of options to work with the library, including: 1) Adding a new item to the library 2) Viewing all stock in the library 3) Lending an item 4) Returning an item 5) Exiting
SSH library for Java
SSH library for Java  SSH library for Java
Ajax library
Ajax library  Hi, What is Ajax Library? List down the latest ajax libraries. Thanks   Hi, Ajax allows the developers to build Ajax based rich internet applications. Ajax libraries is the packaged components
library management system
library management system  coding for library management system
A better Java JSON library?
A better Java JSON library?   A better Java JSON library
XAJAX Library
XAJAX Library       xajax is an open source PHP class library that allows you to easily create powerful, web-based, Ajax applications using HTML, CSS, JavaScript, and PHP. Applications
tag library descriptor
tag library descriptor  i need types of tld ,uses of tld and example program for tag library descriptor
Form Tag library configuration
In this section, you will learn about Spring form tag library and its configuration
library management project
library management project  Is there any similiar methods to that of sendredirect in java
library management project
library management project  Is there any similiar methods to that of sendredirect in java
Library Management in Struts. - Struts
Library Management in Struts.  Hi can you give me the application related to Library Management using Struts Or Jsp
Java FTP Library
Java FTP Library  Which all Java FTP Library available in market? Is there any free open source Java FTP Library? Thanks   Hi, Both open source and commercial Java FTP library are available on Internet. Most used open
online library management
online library management  how to divert user from log in page to home page depending on their category(like student or staff in case of ol library) using java servlet
library files - Development process
library files   Hi members, i am trying to develop a media player in java using netbeans but what library files should i import for this development
Version of cc.tracyzhang>library dependency
List of Version of cc.tracyzhang>library dependency
Version of com.actionbarsherlock>library dependency
List of Version of com.actionbarsherlock>library dependency
Version of com.adlocus>library dependency
List of Version of com.adlocus>library dependency
Version of com.aidangrabe>library dependency
List of Version of com.aidangrabe>library dependency
Version of com.aniways>library dependency
List of Version of com.aniways>library dependency
Version of com.cocosw>library dependency
List of Version of com.cocosw>library dependency
Version of com.cuneytayyildiz>library dependency
List of Version of com.cuneytayyildiz>library dependency