Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP error using JDBCAdapter method

 
Steve Campbell
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet which creates an object "jdbcAdapter" (from examples in JDK). I put the object into a session variable and get this object in a JSP page. When the JSP is being compiled, the line "String sColumnName = jdbcAdapter.getColumnName[col];" comes up as an error with "Attempt to reference method getColumnName in class JDBCAdapter as an instance variable.". I use other methods in this class which don't generate an error like this. Anybody have any ideas on the cause?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use parenthesis() instead of braces[]. Java only uses braces for array references. Parenthesis are used for method calls...
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
Steve Campbell
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic