This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Derby Embedded Database: errors in connection code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Derby Embedded Database: errors in connection code" Watch "Derby Embedded Database: errors in connection code" New topic
Author

Derby Embedded Database: errors in connection code

Malcolm Johnson
Greenhorn

Joined: Feb 14, 2012
Posts: 4
I've coded connection code for an embedded db in NetBeans. Something is wrong with my return connection. Any ideas? I added color=red to the code that is generating the errors, but it is appearing in code. See lines 21, 39, 70, 100, 122, and 144. When trying to compile, I'm getting an error which reads, "cannot find symbol
symbol: variable connection
location: class ProductDB"

This is my first time working with Derby.

Wayan Saryada
Ranch Hand

Joined: Feb 05, 2004
Posts: 104

As the error said that the compiler cannot find the symbol, in this case the connection. For example, in the getProducts() method you tried to access variable named connection but you've never declare this variable. Before using the connection variable you need to declared it, for example:



Website: Learn Java by Examples
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Derby Embedded Database: errors in connection code
 
Similar Threads
BMP, Jboss, and mysql configuring
SQL Syntax Error for MySQL but not sure where...
Out of Memory when testing a BMP Bean
finally block is not executing
Using prepared statements