Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Retrive database connection problem

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone,

I have a problem when i'm trying to recive information from my local database.

Database look like in Untitled.jpg


Untitled.jpg
[Thumbnail for Untitled.jpg]
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what problem is that? What have you tried, and in which way did or didn't it work?
 
gabriel terry
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i received an error when i'm trying to view data from database
error:
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes sense - the SELECT retrieves 8 attributes, so indexes like 9 and 10 are not going to work.
 
gabriel terry
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok
I also tried

Here i must recive 9.
But I can't understand why < 10.
Thank you!
 
Marshal
Posts: 25222
65
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code doesn't make much sense to me:


Since your query is "select id,lastName,firstName,mi,address,city,state,telephone from Staff..." then shouldn't tfID be getting column 1, not 2? And shouldn't tfLastName be getting column 2, not 8? Where did those numbers 2, 8, 9, 2, and 10 come from in the coding process?
 
gabriel terry
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My mistake.
I fix it now.
Thanks a lot!
 
Check your pockets for water buffalo. You might need to use this tiny ad until locate a water buffalo:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!