This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

how to use println for reusltlist in hibernate?  RSS feed

 
Ranch Hand
Posts: 623
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one program which has 2 textfields & 1jbutton
1 table in mysql which contain some values like Actorid,first name,last name,date,i manually enter values in table...
when i run program, in textfield i write specific name then click button, i got result in table.
Now i try to see specific value of that fetched resultlist then how should i do?
eg.


now i try to see by println statement
like
Last name = khire

here i post some code which i think it should contain something should change...





 
Mandar Khire
Ranch Hand
Posts: 623
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should i follow this website's example at the beginning?
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Hibernate are you using. Hibernate is currently on 4.x, and back a number of years ago they released 3.1, in which you no longer should write code like



With Hibernate 3.1 or higher your code should look like



Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using the old style Vector class? I think you want to use ArrayList instead.

Mark
 
Mandar Khire
Ranch Hand
Posts: 623
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

First i try to learn with List then i go forward with ArrayList.
Vector i removed..
I done changes as follows then i can enter values from application to db by hibernate...but cant read it again...
Actually i am trying program in Swing with mysql..program for Drag & drop facility to Array of JPanels within jpanel...
I store old & new location x,y axis in db...
In past i done swing with jdbc...same trying with hibernate instead of jdbc
Complete program i will not post...(people not read code more than few lines...)...but i post code which few lines more than 30...
I am trying as follows:-
at start of program READ, then do some work UPDATE,(after UPDATE immediately need to be READ)...
So i try this


Now i confuse...
In this currently i am trying that db values should print in console when program start...if this possible then i will reuse them as i want.
Any help?
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Swing with mysql..program for Drag & drop facility to Array of JPanels within jpanel… "

We know that already and it is beside the point. Your question doesn't change because of your application. It is irrelevant. You don't have to add that to an ORM question. Do you understand that each part of your application is completely separate and one doesn't change how the other works. If I had a web application with saving People's name, the Hibernate code would be the same no matter what.

You didn't answer my question of what version of Hibernate you are using. Because if you have Hibernate 3.1 or higher, then you are doing the Hibernate code wrong.

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you just overwrote your query you want to run

myhql="Select * from location_parameter_table";
Query q = session1.createQuery(myhql);

So no matter what method calls this method it will always run the exact same query over and over again.

Mark
 
Mandar Khire
Ranch Hand
Posts: 623
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You didn't answer my question of what version of Hibernate you are using. Because if you have Hibernate 3.1 or higher, then you are doing the Hibernate code wrong.


I download latest hibernate version from Hibernate/download Released bundle & same time i use hibernate plugin in eclipse..
I add jar file in project named Hibernate3.jar also i added jars which from that released bundle extract...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!