• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[liferay] My sample project

 
Greenhorn
Posts: 8
Firefox Browser Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having trouble with my project. I want to create a simple input to output portlet that connects to my database. It will supposedly print out a list of records, but it just says "Request Processed Successfully". What am I doing wrong? I am a complete newbie.

view.jsp


Samportlet.java


I thank for any response,
Bite
 
Ranch Hand
Posts: 57
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it even hit the database. Did you try to debug the code flow ?
 
Anthony Fernandez
Greenhorn
Posts: 8
Firefox Browser Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankur Srivastav wrote:Does it even hit the database. Did you try to debug the code flow ?



It does. I changed the SELECT statement because it erroneous.


It still doesn't display? What am I doing wrong?
 
Ankur Srivastav
Ranch Hand
Posts: 57
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One simple observation by looking at the code, just want to make sure you have the if block

if(myResultSet.next())
myDataField1 = myResultSet.getString("acctno");
myDataField2 = myResultSet.getString("fname");
myDataField3 = myResultSet.getString("lname");
System.out.println(myDataField1+" "+myDataField2+" "+myDataField3);
System.out.print("TEST");

I dont see the braces in there ..
 
Anthony Fernandez
Greenhorn
Posts: 8
Firefox Browser Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankur Srivastav wrote:One simple observation by looking at the code, just want to make sure you have the if block

if(myResultSet.next())
myDataField1 = myResultSet.getString("acctno");
myDataField2 = myResultSet.getString("fname");
myDataField3 = myResultSet.getString("lname");
System.out.println(myDataField1+" "+myDataField2+" "+myDataField3);
System.out.print("TEST");

I dont see the braces in there ..



Ah yes! I remedied that:




But the problem persists. I saw some code that does not put "System" before the "out", but I always get an error if I don't put "System", even if I imported java.io.*.
 
Ankur Srivastav
Ranch Hand
Posts: 57
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you still facing issue ? Can you put Exception trace ?
 
Anthony Fernandez
Greenhorn
Posts: 8
Firefox Browser Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankur Srivastav wrote:Are you still facing issue ? Can you put Exception trace ?



I don't know if I can still find those Exception traces, as I do not know how to find it in the logs, but I finally found out how to output results in my portlet! Thanks for helping!
This is my sample portlet...
-------------------------------------------------------------------
view.jsp

--------------------------------------------------------------------
init.jsp

------------------------------------------------------------------
Samportlet.java


I know this may be crude looking to most of you, but it somehow worked for me.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic