• 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

join sql statements

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing an application that connects to a database. I run a select sql statement that joins two tables and I am trying to put the sql results into variables. But I am unable to, the values of the variables is always null. But when I try a simple select statment without a join, it works fine. Is there something that I am missing ? Why does it not work when I join the two tables. In my code, I have ResultSet rs = stmt.executeQuesty(sql); Do I have to use a different method of the statement object ? Any help is appreciated.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no man just make sure your sql statement actually gets results u want.. try running it directly on the database to see what you get.
If the sql statement is correct and all, then i suggest u try this. It is better practice not to select * from table, especially in joins because the issue of the column arrangement has a question mark. It is better to select only the column names that you specifically want and then that should make it really clear .
if the problem still persists tell me what u get exactly.

------------------
KaReEm
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic