|
|
|
@ -23,14 +23,14 @@ public class ReadfrmFromDatabase extends Formlet {
|
|
|
|
|
Form form= new Form(); |
|
|
|
|
String name = reportletRequest.getParameter("reportname").toString(); |
|
|
|
|
try { |
|
|
|
|
// 定义数据连接(根据你实际数据库信息进行修改)
|
|
|
|
|
// 定义数据连接(根据你实际数据库信息进行修改)
|
|
|
|
|
String driver = "com.mysql.jdbc.Driver"; |
|
|
|
|
String url = "jdbc:mysql://localhost:3306/test"; |
|
|
|
|
String user = "root"; |
|
|
|
|
String pass = "123456"; |
|
|
|
|
Class.forName(driver); |
|
|
|
|
Connection conn = DriverManager.getConnection(url, user, pass); |
|
|
|
|
// 从数据库中读模板
|
|
|
|
|
// 从数据库中读模板
|
|
|
|
|
String sql = "select B from report where A = '" + name |
|
|
|
|
+ "'"; |
|
|
|
|
Statement smt = conn.createStatement(); |
|
|
|
|