sql query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhaskar behera
    New Member
    • Nov 2008
    • 4

    sql query

    i have used long sql query in jsp.how i write this sql query line by line in jsp ?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    SQL should not be found in JSP pages at all.
    I'm really not sure what it is that you are trying to ask here.

    Comment

    • itsraghz
      New Member
      • Mar 2007
      • 124

      #3
      If your *real* concern is to have the sql query to be splitted across several lines you can append the portion of queries on each line with the "+" symbol which acts as a concatenation operator.

      Code:
      String mySql = "SELECT * FROM <<tableName>>" +
                            "where tableName.colName in (Select matchingColName FROM " +
                            " <<anotherTableName>> ";
      But as the administrator said, its NOT a good practice to have the SQL inside the JSP and executing it directly as well. Try to read about MVC and follow it.

      Comment

      Working...