• 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

using a session value on sql query

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting a value from a drop down menu and storing it in the sessions bean. However when I try to get that value to use it on a query i am getting an error. That value is the DB that i am going to use for my query...

these are my values...what am i doing wrong?

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eduardo Ponce de Leon wrote: i am getting an error.


Keeping the error a secret isn't going to help us help you.
 
Eduardo Ponce de Leon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The erros is saying that the DB does not exist...and its true the database "db" is not the name of my databes, my problem is that i dont know how to set the value of the stored value of my bean in the sql query.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sigh. Show the entire error message.
 
Eduardo Ponce de Leon
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...so this is my query...

SELECT
"JUN_F1"."Renta"
FROM
public."JUN_F1"
WHERE
"JUN_F1"."Telefono" = '9717029902';

JUN_F1 is the name of my table but that name, however this name is formed by JUN (variable) and _F1 (text)...I cant write my query to store in a string variable to do what i need to do, the problem is the quotes..basically my query will look like this...



remember... month is the value stored in another variable and _F1 is plain text
This is what i want to do..

String query = "SELECT "month+_F1"."Renta" FROM public."month+_F1" WHERE "month+_F1"."Telefono" = '9717029902';";

any help with the quotes!!
 
I like tacos! And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic