Showing posts with label modifikasi hibernate. Show all posts
Showing posts with label modifikasi hibernate. Show all posts

Sunday, March 31, 2013

cara memodifikasi hibernate.cfg.xml


Berikut ini merupakan source cara memodifikasi   hibernate.cfg.xml. Mengapa kita butuh modifikasi? 

Modifikasi ini berfungsi untuk membuat hibernate bisa berjalan secara dinamis, jadi ketika ada perubahan di database atau url kita bisa langsung merubah dari aplikasi yang kita buat. Mungkin itu yang bisa saya pahami. Selamat mencoba ^.^

// Create the SessionFactory from hibernate.cfg.xml
 Configuration hc= new Configuration();
 hc.setProperty("hibernate.dialect","org.hibernate.dialect.MySQLDialect");
 hc.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");
 hc.setProperty("hibernate.connection.url", "jdbc:mysql://" + "localhost:3306" + "/" + "db");
 hc.setProperty("hibernate.connection.username", "root");
 hc.setProperty("hibernate.connection.password", "");
  hc.addResource("adicodes/pojo/Pojo.hbm.xml");
 sessionFactory = hc.buildSessionFactory();

Aplikasi Web Crawler Untuk Pengarsipan Konten Web

Berikut ini printscreen tampilan dari aplikasi web crawler : Gambar 1 Splashscreen Gambar 2  Halaman Utama Gambar 3  Pengat...