Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pass column name as parameter  RSS feed

 
neelesh kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to pass column name as a parameter using servlets?
I tried using the following code but it doesnt work


String date=request.getParameter("date");
String sql="alter table cs1_cn add " +date+ " boolean";
PreparedStatement ps=conn.prepareStatement(sql);
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just text. The fact that it's going to be used as a column name is irrelevant.

Please read ItDoesntWorkIsUseless
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!