Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / July 2004

Tip: Looking for answers? Try searching our database.

how can i query different tables using a parameterRow or through other methods?

Thread view: 
Marcolm - 18 Jul 2004 20:44 GMT
hi,everyone
I'm new in java.
I want to query a table that depending on jdbTextField1.getText(). Tha
is to say the content of jdbTextField1.getText() is the name of table
want to query. I tried to used these SQL codes:
SELECT *
FROM :table_name;//  table_name = jdbTextField1.getText()
But it doesn't work. Help~
-
Marcol
-----------------------------------------------------------------------
Roedy Green - 18 Jul 2004 20:56 GMT
>I want to query a table that depending on jdbTextField1.getText(). That
>is to say the content of jdbTextField1.getText() is the name of table i
>want to query. I tried to used these SQL codes:
>SELECT *
>FROM :table_name;//  table_name = jdbTextField1.getText()
>But it doesn't work. Help~!

You will need something along this line:

String tableName = whichTable.getText();
String query =    "SELECT * FROM " + tableName;

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.