| Author |
Get table names
|
Joseph Smithern
Ranch Hand
Joined: Feb 11, 2006
Posts: 89
|
|
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
Joined: Jan 10, 2002
Posts: 56196
|
|
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?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56196
|
|
|
Why would you be doing something like this in a JSP in the first place?
|
 |
Joseph Smithern
Ranch Hand
Joined: Feb 11, 2006
Posts: 89
|
|
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
Joined: Jan 10, 2002
Posts: 56196
|
|
|
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
Joined: Aug 09, 2006
Posts: 93
|
|
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
Joined: Jan 10, 2002
Posts: 56196
|
|
Originally posted by Rusty Smythe: the Bog Monster of Misunderstanding Encapsulation
Who frequently shows up with his cousin, the Spectre of Premature Optimization.
|
 |
 |
|
|
subject: Get table names
|
|
|