File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Table name as textbox? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Table name as textbox?" Watch "Table name as textbox?" New topic
Author

Table name as textbox?

Sujay Nadkarni
Ranch Hand

Joined: Jul 03, 2008
Posts: 34
We have a form where the user enters the name of an index in the textbox. We want to create a table with the same name as that entered in the textbox..


IAtest.jsp


This is what we tried!!
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
This code doesn't even compile. Start learning how to concat strings. This is covered by every basic Java tutorial/book. If you stucks, try the beginners forum.

That said, this stuff doesn't belong in a JSP file, but in a Java class. Writing raw Java code (scriptlets) in JSP is simply asking for trouble.
Sujay Nadkarni
Ranch Hand

Joined: Jul 03, 2008
Posts: 34
Hey Thanks a ton!! i solved the problem using concatenation. It wouldnt have struck if you had not helped..thanks alot
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Next step is to save your code from SQL injections.
Read on about PreparedStatement.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Table name as textbox?
 
Similar Threads
pass the value to next form
DATABASE LOCKED????
Combobox-java servlet
How to store option format value in database in jsp
Need Help With Dynamic text box in JSP