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



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


poonam
hi i m new to hibernate..plzzzzzzzzzzzzzz help me....
2 Answer(s)      6 years and 6 months 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
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 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
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
Hii i want a JMS application can anybody help me
Hii i want a JMS application can anybody help me  jms application
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. 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
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
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  Hi, LWUIT is working in eclipse j2me for Symbian OS
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
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  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
Advertisements
 

 

 

DMCA.com