It looks like you are using "name_of_table" where it should be the
"column_name_of_table"

Tom Kochanowicz

protected final int COLUMN_POSITION = 1;
displayStatementWordAdInfoView.setString(COLUMN_POSITION,
some_variable_from_getParameter);


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Robert Pimentel
Sent: Thursday, January 06, 2000 10:17 AM
To: [EMAIL PROTECTED]
Subject: PreparedStatement trouble


Hi :)

I apologize, slightly off-topic. I'm hoping a few people here have worked
with JDBC.

Having trouble with my preparedStatment. I'm trying to assign a value to my
placeholder.The SQLException is raised. Error ORA-00903 Invalid table name.
Here's some of the code.

PreparedStatement pstmt = conn.prepareStatement("Select * from ?");
pstmt.setString(1, "name_of_table");
ResultSet rset = pstmt.executeQuery();

I've tried using different table names. No luck. I also tried assigning the
value to a String first (i.e String tab_name = "name_of_table";). No luck.
I've also tried PreparedStatement pstmt = conn.prepareStatement("Select
column1 from ?"); In case the '*' was causing a problem. Still no luck. Is
it even possible to dynamically assign the name of a table with a
PreparedStatement?? Am I forgetting something??

Tia,

-Robert-

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to