• 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

Derby Embedded Database: errors in connection code

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 119
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

reply
    Bookmark Topic Watch Topic
  • New Topic