File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get table names

 
Joseph Smithern
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get all table names in MySQL database using Tomcat 5.5 container.




Gives me errors saying:


An error occurred at line: 8 in the jsp file: /num/TableName.jsp
Generated servlet error:
Illegal modifier for the variable con; only final is permitted

An error occurred at line: 8 in the jsp file: /num/TableName.jsp
Generated servlet error:
Illegal modifier for the variable databaseMetaData; only final is permitted
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try taking the java scriptlet you wrote and plop it into the middle of a method. You'll find that it's chock full of errors.

The Java you put into JSP scriplets must follow the same rules as "real" Java classes.

Specifically, can you declare public variable insode a java method?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you be doing something like this in a JSP in the first place?
 
Joseph Smithern
Ranch Hand
Posts: 89
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

I was trying to learn more about pulling info out of a database.
I will try other things first since this wont work.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do yourself a favor and keep the database access in Java classes where they belong... as far away from the UI as they can get.
 
Rusty Smythe
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Why would you be doing something like this in a JSP in the first place?


I vote for the Devil of Cut 'n' Paste or the Bog Monster of Misunderstanding Encapsulation.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rusty Smythe:
the Bog Monster of Misunderstanding Encapsulation


Who frequently shows up with his cousin, the Spectre of Premature Optimization.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic