Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Table name as textbox?

 
Sujay Nadkarni
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next step is to save your code from SQL injections.
Read on about PreparedStatement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic