Home Discussion Discuss: Complete Hibernate 3.0 Tutorial

  • hibernateSubash Thirimanna March 11, 2011 at 7:03 AM

    You are doing an excellent job

  • downloaadjogandra March 15, 2011 at 7:30 PM

    Nice book

  • javasatishkumar June 20, 2011 at 12:21 AM

    package writer; import java.io.File; import java.io.IOException; import java.util.Locale; import jxl.CellView; import jxl.Workbook; import jxl.WorkbookSettings; import jxl.format.UnderlineStyle; import jxl.write.Formula; import jxl.write.Label; import jxl.write.Number; import jxl.write.WritableCellFormat; import jxl.write.WritableFont; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import jxl.write.WriteException; import jxl.write.biff.RowsExceededException; public class WriteExcel { private WritableCellFormat timesBoldUnderline; private WritableCellFormat times; private String inputFile; public void setOutputFile(String inputFile) { this.inputFile = inputFile; } public void write() throws IOException, WriteException { File file = new File(inputFile); WorkbookSettings wbSettings = new WorkbookSettings(); wbSettings.setLocale(new Locale("en", "EN")); WritableWorkbook workbook = Workbook.createWorkbook(file, wbSettings); workbook.createSheet("Report", 0); WritableSheet excelSheet = workbook.getSheet(0); createLabel(excelSheet); createContent(excelSheet); workbook.write(); workbook.close(); } private void createLabel(WritableSheet sheet) throws WriteException { // Lets create a times font WritableFont times10pt = new WritableFont(WritableFont.TIMES, 10); // Define the cell format times = new WritableCellFormat(times10pt); // Lets automatically wrap the cells times.setWrap(true); // Create create a bold font with unterlines WritableFont times10ptBoldUnderline = new WritableFont( WritableFont.TIMES, 10, WritableFont.BOLD, false, UnderlineStyle.SINGLE); timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline); // Lets automatically wrap the cells timesBoldUnderline.setWrap(true); CellView cv = new CellView(); cv.setFormat(times); cv.setFormat(timesBoldUnderline); cv.setAutosize(true); // Write a few headers addCaption(sheet, 0, 0, "Header 1"); addCaption(sheet, 1, 0, "This is another header"); } private void createContent(WritableSheet sheet) throws WriteException, RowsExceededException { // Write a few number for (int i = 1; i < 10; i++) { // First column addNumber(sheet, 0, i, i + 10); // Second column addNumber(sheet, 1, i, i * i); } // Lets calculate the sum of it StringBuffer buf = new StringBuffer(); buf.append("SUM(A2:A10)"); Formula f = new Formula(0, 10, buf.toString()); sheet.addCell(f); buf = new StringBuffer(); buf.append("SUM(B2:B10)"); f = new Formula(1, 10, buf.toString()); sheet.addCell(f); // Now a bit of text for (int i = 12; i < 20; i++) { // First column addLabel(sheet, 0, i, "Boring text " + i); // Second column addLabel(sheet, 1, i, "Another text"); } } private void addCaption(WritableSheet sheet, int column, int row, String s) throws RowsExceededException, WriteException { Label label; label = new Label(column, row, s, timesBoldUnderline); sheet.addCell(label); } private void addNumber(WritableSheet sheet, int column, int row, Integer integer) throws WriteException, RowsExceededException { Number number; number = new Number(column, row, integer, times); sheet.addCell(number); } private void addLabel(WritableSheet sheet, int column, int row, String s) throws WriteException, RowsExceededException { Label label; label = new Label(column, row, s, times); sheet.addCell(label); } public static void main(String[] args) throws WriteException, IOException { WriteExcel test = new WriteExcel(); test.setOutputFile("c:/temp/lars.xls"); test.write(); System.out .println("Please check the result file under c:/temp/lars.xls "); } } package reader; import java.io.File; import java.io.IOException; import jxl.Cell; import jxl.CellType; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; public class ReadExcel { private String inputFile; public void setInputFile(String inputFile) { this.inputFile = inputFile; } public void read() throws IOException { File inputWorkbook = new File(inputFile); Workbook w; try { w = Workbook.getWorkbook(inputWorkbook); // Get the first sheet Sheet sheet = w.getSheet(0); // Loop over first 10 column and lines for (int j = 0; j < sheet.getColumns(); j++) { for (int i = 0; i < sheet.getRows(); i++) { Cell cell = sheet.getCell(j, i); CellType type = cell.getType(); if (cell.getType() == CellType.LABEL) { System.out.println("I got a label " + cell.getContents()); } if (cell.getType() == CellType.NUMBER) { System.out.println("I got a number " + cell.getContents()); } } } } catch (BiffException e) { e.printStackTrace(); } } public static void main(String[] args) throws IOException { ReadExcel test = new ReadExcel(); test.setInputFile("c:/temp/lars.xls"); test.read(); } }

  • download sunil August 18, 2011 at 5:53 AM

    nice site for java developer

  • hibernateRichard W. Brittain June 3, 2013 at 1:12 AM

    My son just got a new computer and a friend helped him with the installation. His friend said that instead of shutting down, he could put it in hibernation. Mike's computer is in hibernation mode now but we don't know how to get it out. Can someone please tell us how to. Thx! Richard

  • ORMpallab September 14, 2011 at 5:47 PM

    Introductions to ORM, What is ORM and why it is required ... http://java-pallab.blogspot.com/2011/09/object-relation-mapping.html

  • bXIzrAwcsaRFrkejZopChassidy November 1, 2011 at 4:46 PM

    It's great to read something that's both enjoyable and provides pragmatisdc souloitns.

  • HIBERNATEPRAMOD January 25, 2012 at 8:28 PM

    TEL ME D DIFFERENCE B/W HIBERNATE-SPRING AND OTHR HIGH END FRAMEWOKS

  • BvUehJOrkluDJKuCarlinda January 19, 2013 at 2:08 AM

    IMHO you've got the right anwesr!

  • HibernateImby May 6, 2012 at 1:10 PM

    Thanks

  • hibernateRaju Kumar October 13, 2012 at 11:36 PM

    no comment, satisfied...

  • tnIYAdLZbzsbAToloqoVincent June 13, 2013 at 8:10 PM

    Barney,First off I took a look at the CFGroovy project and I have to say great work so far. In all of your eelapmxs I saw way to sprinkle groovy throughout the code but no eelapmxs of way to use it as the model. Is there a way to remove my components and use it as the model? The one problem I have with CFC's (should be better in CF9) is that they are way to verbose for my liking. Either way keep up the great work and any little apps that you could post that show CFGroovy in the wild would help those of us interested in using it. Keep up the great work!

  • Thanks a lotark September 29, 2013 at 7:34 PM

    Thanks for your posting.It was very easy to understand. Can you post some material that throws some light on drawback of hibernate as compared to JPA. Also how can we achieve loose coupling without using spring. Thanks in advance

  • How to integrate struts2.0 with Hibernate3GURU April 3, 2012 at 4:50 PM

    We understood well, how to create struts and hibernate. But we don't know how to integrate Struts2.0 and Hibernate-3 for connecting with data base. So kindly could you teach, how to integrate both.

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Hibernate Tutorial Example

Introduction to Hibernate 3.0
Introduction to Hibernate 3.0       What is Hibernate? Hibernate 3.0, the latest Open Source... Hibernet.org.The Hibernate 3.0 core is 68,549 lines of Java code together 

Hibernate Tutorial Example

Complete Hibernate 3.0 and Hibernate 4 Tutorial
Complete Hibernate 3.0 and Hibernate 4 Tutorial   ...; Tutorial Basics: Hibernate 4.2.7 Maven dependency - Learn how to use... Hibernate 4 Tutorials Hibernate 4 Tutorial More 

Hibernate Tutorial Example

Running First Hibernate 3.0 Example
Running First Hibernate 3.0 Example       Hibernate is free open source software it can... first Hibernate 3.0 example 

Spring Framework

Spring 3.0 Tutorials with example code
Spring 3.0 - Tutorials and example code of Spring 3.0 framework In this Spring 3.0 tutorial you will learn Spring 3.0 with the help of example code. The Spring 3.0 tutorial explains you different modules 

Blog

Sitemap Hibernate Tutorial
| Site Map | Business Software Services India Complete Hibernate  Tutorial Section Introduction to Hibernate 3.0 | Hibernate Architecture | First Hibernate Application | Running the Example in Eclipse | Understanding 

Servlets

Servlet 3.0 Tutorial
This section contains detailed tutorial with sample code on the major upgradation in Servlet 3.0 API 

Hibernate Tutorial Example

Running First Hibernate 3.0 Example
Running First Hibernate 3.0 Example   ... Hibernate 3.0. This is very easy to follow tutorial and you can create your.... In this section I showed you how to run the our first Hibernate 3.0 example 

General

Welcome to the Jboss 3.0 Tutorial
Welcome to the Jboss 3.0 Tutorial  ...;  Building Web Application With Ant and Deploying on Jboss 3.0... on the Jboss 3.0 application server. After the completion of this lesson 

Hibernate-Tutorials

Hibernate Tutorial Roseindia
in this framework and needs a deep understanding. Hibernate tutorial at Roseindia... to Hibernate 3.0 Hibernate Architecture First Hibernate Application Running...Roseindia.net provides you the best Hibernate tutorials with full examples 

Hibernate Questions

Hibernate tutorial - Hibernate
Hibernate tutorial  can u provide me some material in hibernate.  Hello Rohin,You can learn Hibernate within 10 days from our website. In our hibernate tutorial you will find many examples with running code. You can 

Hibernate Tutorial Example

Introduction to Hibernate 3.0
 

Hibernate Questions

hibernate code - Hibernate
hibernate code  sir, i have tried ur hibernate 3.0 firt example code, i have done as u have told in the tutorial like import all the related jar files,made asimple java project and copied the two xml files into src/bin 

JEE 5

What is EJB 3.0?
What is EJB 3.0       This lesson introduces you with EJB 3.0, which is being used extensively... Bean acts as message consumer and it receives JMS messages. EJB 3.0 New 

Hibernate Tutorial Example

Quick Hibernate Annotation Tutorial
hands on experience before starting this tutorial. Introduction:- Hibernate... Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate...Hibernate Annotations       

Hibernate Interview Questions

HIBERNATE
HIBERNATE  How u connects database using hibernate 3.0? Where you have written the database configuration details 

Hibernate Questions

Encountering error when connecting MSSQL Server 2005 using Hibernate 3.0
Encountering error when connecting MSSQL Server 2005 using Hibernate 3.0  Hi, Im a beginner to the hibernate framework.Im encountering the following error when connecting to the MSSQLServer 2005 using hibernate 3.0 My 

Hibernate Questions

Hibernate programming tutorial for beginner
Hibernate programming tutorial for beginner  Hi, I am beginner... quick tutorial for learning Hibernate. Can someone point me to a step by step... the link: Hibernate beginner tutorial. This link contains many tutorials 

Hibernate Questions

Hibernate 4 annotations tutorial
Hibernate 4 annotations tutorial  Hi, I am trying to find the best Hibernate 4 annotations tutorial. I think there is good tutorial on your site. Please tell me the url of Hibernate 4 annotations tutorial. Thanks   hi 

Hibernate-Tutorials

MyEclipse Hibernate Tutorial
This tutorial is helpful to understand how hibernate work in MyEclipse 

Framework Questions

What is the difference between EJB 3.0 and JPA - Framework
persistance API ). HIbernate 3.0 implements the JPA specification. EJB 2.1...What is the difference between EJB 3.0 and JPA   What is the difference between EJB 3.0 and JPA. How can they work together. Does EJB 3.0 need 

Hibernate Interview Questions

Hibernate sample code - Hibernate Interview Questions
Surjeet  Hi friend, Hibernate 3.0, the latest Open Source persistence... Hibernet.org.The Hibernate 3.0 core is 68,549 lines of Java code together with 27,948 lines... in database. I For read more information,Example and Tutorial On Hibernate 

J2EE

File Upload Servlet 3.0 Example
File Upload Servlet 3.0 Example In this tutorial you will learn how to upload a file in servlet 3.0 In this example I have used the @MultipartConfig annotation to upload the file. Earlier versions than the servlet 3.0 specification were 

Hibernate Questions

Explain Hibernate Relationships with example.
these links would be helpful: Complete Hibernate 3.0 and Hibernate 4 Tutorial Hibernate Tutorial...Explain Hibernate Relationships with example.  Hello, Please explain 

Spring Framework Questions

The @configuration annotation example in Spring 3.0 Framework
The @configuration annotation example in Spring 3.0 Framework  I was going through the tutorial on Spring for "The @configuration annotation example in Spring 3.0 Framework" but I am getting following error when I Run 

Java-Tutorials

Hibernate Tutorial
Hibernate Tutorial This section contains the various aspects of Hibernate. Here we will read What is Hibernate, Features of Hibernate, Compatibility... this tutorial. Hibernate 4 Hibernate 3 Hibernate 2 First final release of hibernate 

Hibernate Questions

Hibernate
Hibernate  hi sir i need hibernate complete tutorial for download   Hi Friend, Please visit the following link: Hibernate Tutorials Thanks 

Hibernate Questions

Hibernate
Hibernate  I downloaded the zip file given in the tutorial of Hibernate. I followed all th steps as given in the tutorial, but a build error... the example from Hibernate Getting Started Tutorial. Please follow the steps 

Hibernate-Tutorials

Complete Hibernate 4.0 Tutorial
This section contains the Complete Hibernate 4.0 Tutorial. Complete Hibernate 4.0 Tutorial Hibernate is a Object-relational mapping...: Hibernate 4 Annotations Tutorial Given below the complete list of topics 

Hibernate Questions

Please explain Hibernate Sessionfactory.
Complete Hibernate 3.0 and Hibernate 4 Tutorial Let me know if the problem persists...Please explain Hibernate Sessionfactory.  Hi there, Please explain Hibernate session factory in detail. I have just started learning hibernate so i 

Hibernate Tutorial Example

Hibernate 4 Tutorial
Hibernate 4 Tutorial The latest version of Hibernate 4 Tutorial comes... application much easier. In this Hibernate 4 Tutorial series you will find many... Hibernate quickly. What is covered in Hibernate 4 Tutorial? Following topics 

DMCA.com