hi i m new to hibernate..plzzzzzzzzzzzzzz help me....

hi i m new to hibernate..plzzzzzzzzzzzzzz help me....

View Answers

July 23, 2008 at 1:45 PM

Hi poonam

This is wrong query. you are using wrong query.

String SQL_QUERY = "from Contact contact";



Read for more information.

http://www.roseindia.net/hibernate/selectclause.shtml



Thanks.

July 23, 2008 at 2:07 PM

hi deepak..
when i change my query ...
now its showing me this error...
plz help me.....

MY PRG IS::::::::::

package indiabulls.test;

import org.hibernate.*;
import org.hibernate.cfg.*;
import java.util.*;
public class SelectExample
{
public void getdata()
{ Session session = null;
try
{
System.out.println("lj;kj");
// This step will read hibernate.cfg.xml and prepare hibernate for use
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
System.out.println("********CONNECTION MADE***********");
String SQL_QUERY = "Select contact.id, contact.firstName, contact.lastName, contact.email from Contact contact";
//String SQL_QUERY = "from indiabulls.test.Contact contact";

Query query = session.createQuery(SQL_QUERY);
System.out.println("SQL_QUERY : "+SQL_QUERY);
Iterator it=query.iterate();
while(it.hasNext())
{
//System.out.println("******* " +it.next());
Contact contact=(Contact)it.next();
// Object[] row = (Object[]) it.next();
System.out.println("ID: " + contact.getId());
System.out.println("LastName: " + contact.getLastName());
System.out.println("Email: " + contact.getEmail());
}
System.out.println("*******Done********");
session.close();
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}

public static void main(String[] args)
{
SelectExample s=new SelectExample();
s.getdata();
}

}


ERROR:::::::

SQL_QUERY : Select contact.id, contact.firstName, contact.lastName, contact.email from Contact contact
could not execute query using iterate

now its showing that this query cant be executed









Related Tutorials/Questions & Answers:
hi i m new to hibernate..plzzzzzzzzzzzzzz help me.... - Hibernate
hi i m new to hibernate..plzzzzzzzzzzzzzz help me....  hi friends i m new to hibernate..& i m stuck in one positon in my pgm.. its a simple select...://www.roseindia.net/hibernate/selectclause.shtml Thanks.  hi deepak.. when i
hi frnds.. help me..
hi frnds.. help me..  i ve a doubt in incompatible type error (block letter). plz help me clear this error! thanks in advance. This is my code. double velo[][] = new double [task] [resource]; for(int i=0;iList<Double>
Advertisements
hi , i cant make this programmer , can any one help me to make it pls - Java Beginners
hi , i cant make this programmer , can any one help me to make it pls  ... java streams (FileReader, FIleWriter,...) and allows creating and opening of new... a new text file ? -Open and append (add new information to ) an existing file
PLZ HELP ME. i need php code.
PLZ HELP ME. i need php code.   I want php code for bellow OUTPUT. output is just example but it must be letters only. abc bcd efg jku rgt azs hje qqc wws adt
Hi i am new to J2ee Technology and struts - Struts
Hi i am new to J2ee Technology and struts  what exatly will happen when we hit the Login button? Once we enter in to the application, what will happen. How the UserID and Password validations will done. Can any one help
help me
help me  hi sir pls tell me how to use ajax form validatin from very simple way with two ot three text field pls help me use ajax in php my email id is:- [email protected] pls sir give me some vasic information i know
i need latest oracle certified java dumps.. Pleas help me?
i need latest oracle certified java dumps.. Pleas help me?  i need latest oracle certified java dumps.. Pleas help me
i have a problem to do this question...pls help me..
i have a problem to do this question...pls help me..  Write a program....   Hi Friend, Try this: import java.util.*; public class ReverseNumber... reversedNumber = 0; for (int i = 0; i <= num; i
sir i,have a assignment for these question plz help me sir - JavaMail
sir i,have a assignment for these question plz help me sir  ...; Hi Friend, Try the following codes: 1)ADT Stack: import... { int arr[] = new int[n]; int top = -1; public void push() { try
help me
help me  HI. Please help me for doing project. i want to send control from one jsp page to 2 jsp pages... is it possible? if possible how to do
help m e
help m e  11 12 22 13 23 33 14 24 34 44 15 25 35 35
inheritance....please help me friends...!!!... this is important project that i have to do it..
inheritance....please help me friends...!!!... this is important project that i have to do it..   Point ................. #x : int #y : int.... - Call function setRadius() by assigning 3.0 to new value of radius
Hii i want a JMS application can anybody help me
Hii i want a JMS application can anybody help me  jms application
help me
help me  i have done as u directed but nothing happens gud to me..... . i am using netbeans is that matter at all help me and take me out from trouble where to store jfree api to use it for j2ee based project
plaz help me i try to compile from last 2 day .
plaz help me i try to compile from last 2 day .   org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 34 in the jsp file: /saveUpdate.jsp name cannot be resolved to a variable 31
plaz help me i try to compile from last 2 day .
plaz help me i try to compile from last 2 day .   org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 34 in the jsp file: /saveUpdate.jsp name cannot be resolved to a variable 31
help me
help me  Hi I'm loges. I'm doing my final year project now, I have some problem in my project and i need some help on it. NowI'm doing a site... button, and nationality I'm using dropdown list. Please help me. your kindness
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2> <script language = "Javascript"> function checkEmail
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..
hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work on it ..   hi .. need help ASAP ..i have a project buit in eclipse , i have installed jasper. i want the steps to work
help me
help me  please send me the java code to count the number of similar words in given string and replace that word with new one
Hi Every One , please give me some idia to opning audio File . please Help ..
Hi Every One , please give me some idia to opning audio File . please Help ..  hi Dear Friend , please give me a program to opening audio file... me .please Help
hi,i'am new to Jsp.Can some one please let me know an answer for this question?
hi,i'am new to Jsp.Can some one please let me know an answer for this question?  how do we upload an xml file and validate them against WIPO DTD
help me
help me... class.Several lines of customer should be displayed. you can add a new customer... , one checked out , the customer is removed from the line. in addition, i want
help me
help me  Dear sir/medam i would like to know how to use the java... the order, Fourth button is Find length of text. and there are panels. Please help me. i want to write the code on this program. please share ur idea.   
Hi.. how to write more than one sheets in a excel file... pls anybody help me....
Hi.. how to write more than one sheets in a excel file... pls anybody help me....  i can write only one sheet in a excel file.. but i want to write... go to second sheet... pls help me.. here my code.. import
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my... the anagram on screen or the output file! Please show me whats wrong. Thanks i... signatures= new Vector(MAX_WORDS); String tempWord, fileName; Scanner
help me..
help me..   what are the component needed by grid computing, cloud computing and ubiquitous computing? discuss about the security of above computing. difference between that 3 computing
help me
help me  MY GLASSFISH SERVER NOT START PROPERLY help me warning shows DPL5404:Specification-Version for the optional package [ GNUJAXP ] in the jarfile [ C:\Program Files\Java\jdk1.7.0_02\jre\lib\ext\gnujaxp.jar
Help me
Help me  Hi, LWUIT is working in eclipse j2me for Symbian OS
Help me
Help me  hello!!!!. i have a Excel file which includes 4 columns and somewhat 8500 rows.these rows i have printed in SQL thru Excel file and i have 1 MYSql database which includes all those 4 fields i have defined in excel file
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please  * Description* You are hired to develop a laptop inventory information system for Sheridan College in order to keep track of the information about
Help me
Help me  plz i want code of program to add real numbers and magic numbers in java example this input :- 5+3i-2+3i output:- 3+6i
help me...
help me...  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog
help me..
help me..  Write a program that inputs four words and them displays all possible permutations of the words. So, for example, if the words mad, dog, bites and man are entered, then the following are output : man bites mad dog mad
I want to update the multiple values of database depending on checkbox..? Please help me out..
I want to update the multiple values of database depending on checkbox..? Please help me out..   Hi .. I want to Update the multiple values of database using checkboxes and want to set the session for selected checkboxes
help me...
help me...  there is the picture given - cat - dog - rabbit - mouse a. create a class name b. create its attributes (at least 3 attributes) : species, size, leg c. create its methods ( at least 3 methods) : walk, eat, sleep
help me
help me  I have a quastion a bout array whic is>>> 1-write aprogram to diplay a multiplication table for 1to 10 by entering the start number and the end number. EXAMPLE: ENTER START NUMBER:1 ENTER END NUMBER:3
Help me
Help me  HI I am using Tomcat6.0 this is the problem i got wen i run... bgcolor="white"> <h1> I have been invoked by &lt;% out.print... a clear resolution to this vexing issue? Thanks in advance.  Hi Friend
sir i want small project with of health care system with struts and hibernate plz help me
sir i want small project with of health care system with struts and hibernate plz help me  sir i want small project on health care system with struts and hibernate plz help me
help me..
help me..  Design and write a class named Person and its two subclasses named Student and Employee. Make Lecturer and Admin subclasses of Employee. A person has a name, address, phone number and email address. A student has
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out
sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out  sir/mam i want to have knowledge on live projects of java/jsp/servlets.Can you plz help me out.I want to have a through knowledge
Help me
Help me  HI I am using Tomcat6.0 this is the problem i got wen i run the code , i am using login.html ,login .jsp,login.java and web.xml code...&gt; I have been invoked by &amp;lt;% out.print(request.getAttribute
help me
help me  how to print from a-z, A-Z with exact order using for loop? Thanks for all concern
Help Me
Help Me  What is the source code for Sample example for Mortgage Calculator in J2ME language for developing Symbian
i want to find the byte code of a image file ... for my project..plz if anybody help me for java coding i will grateful..
help me for java coding i will grateful..   i want to convert a image file to its byte code format that help me for the pattern matching in my... help me
plz help me - Java Beginners
give me reponse my persinal given id  Hi ragni, i am sending...plz help me  Thanks deepak continue response..i face some problem i.... if i m login then display sessionvalid .jsp not display admin page i want display
help me
help me  pls... xplain dis code:- function go() { window.location.replace("logout.jsp",'window','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1'); self.close
help me - WebSevices
help me   help me with the principals of designing agood websites and i can start

Ads