Jsp queries mysql. The table name is a variable and needs to be input in the previous section. how can this problem be achieved?

Source: Internet
Author: User
Such as Question .... It was written one afternoon because the table name is a variable and cannot be implemented .... & Quot; stmtconn. createStatement (); Stringsql & quot; select * from"+table1+"wherestation'"+station1+"'";ResultSetrsstmt.exe cuteQuery (SQL); & quot; cannot be connected but & quot; Stringsql & quot; select mysqljsp

Such as Question .... It was written one afternoon because the table name is a variable and cannot be implemented ....

Stmt = conn. createStatement (); String SQL = "select * from" + table1 + "where station = '" + station1 + "'"; ResultSet rs = stmt.exe cuteQuery (SQL );
This cannot be connected,
String SQL = "select * from" + table1; String SQL = "select * from sql201307 where station = '" + station1 + "'";
You can do this... I really don't understand

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.