Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Hibernate hi i m new to hibernate..plzzzzzzzzzzzzzz help me....

Have Programming Question? Ask it here!
 
 
 


poonam
hi i m new to hibernate..plzzzzzzzzzzzzzz help me....
2 Answer(s)      6 years and a month ago
Posted in : Hibernate



Advertisement
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
help m e
help m e  11 12 22 13 23 33 14 24 34 44 15 25 35 35
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
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
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
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
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
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:- rohit11tripathi@gmail.com pls sir give me some vasic information i know
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
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
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
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
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
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
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
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
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
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
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.   
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  Hi, LWUIT is working in eclipse j2me for Symbian OS
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..   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
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP  as i said i want... the database using JSP. like country,state,city..please guide me
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
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  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
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
New to Java Please help
New to Java Please help  Hi I need help, can some one help me with this. I am currently doing a project. drop me an email to my email address. Thanks!   If you are new in java, then you need to learn core java
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
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  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
I need to launch multiple instances of IE browser from one windows M/C on the another windows M/C
I need to launch multiple instances of IE browser from one windows M/C on the another windows M/C  multiple instances of IE browser from one windows M/C on the another windows M/C
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..  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
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  What is the source code for Sample example for Mortgage Calculator in J2ME language for developing Symbian
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  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
help me  Create a GUI application that allows a user to select a text file (using the JFileChooser). The program will then allow the user to do the following operations (selection of these operations must be made by clicking
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
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this
I am trying to develop a Image Sliding application but unfortunately its not working... Can any one help me in this  Can Anyone Help Me...); Container con=this.getContentPane(); jp1=new JPanel
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
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
 

 

 

DMCA.com