jsp内嵌java代码怎么将jsp上的值<s:property value="#car.lb"/>l赋值传给carlb
<%//加载驱动程序Class.forName("org.postgresql.Driver");//建立连接Connectionconn1=DriverManager....
<%
//加载驱动程序
Class.forName("org.postgresql.Driver");
//建立连接
Connection conn1=DriverManager.getConnection("jdbc:postgresql://localhost:5432/wojiazupin","postgres","123");
//发送SQL语句
Statement stmt1=conn1.createStatement();
try{
//建立ResultSet(结果集)对象
ResultSet rs;
//执行SQL语句
rs=stmt1.executeQuery("SELECT distinct location FROM fuwufei where carlb=?");
%> 展开
//加载驱动程序
Class.forName("org.postgresql.Driver");
//建立连接
Connection conn1=DriverManager.getConnection("jdbc:postgresql://localhost:5432/wojiazupin","postgres","123");
//发送SQL语句
Statement stmt1=conn1.createStatement();
try{
//建立ResultSet(结果集)对象
ResultSet rs;
//执行SQL语句
rs=stmt1.executeQuery("SELECT distinct location FROM fuwufei where carlb=?");
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询