首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

2011 十 21

2012-08-24 
2011 10 21jsp中代码要写%%jsp:setProperty namerent propertywidth paramwidth/注意param和

2011 10 21

jsp中代码要写<%%>

<jsp:setProperty name="rent" property="width" param="width"/>

注意param和value ?可能会出错误啊

<jsp:setProperty name="rent" property="*"/>

使用javabean要注意引进包啊

<%@ page import="bean.rent" %>

<jsp:getProperty name="rent" property="xxxxx"/>

<jsp:forward page="c.jsp"/> ?也可以进行跳转

?

oracle:

class.forName("oracle.jdbc.driver.OracleDriver")



try{Class.forName("oracle.jdbc.driver.OracleDriver");}catch(ClassNotFoundException e){}try{String url="jdbc:oracle:thin:@localhost:1521:XE";Connection conn=DriverManager.getConnection(url,"ancong","ancong");Statement stmt=conn.createStatement();String sqlinsert="insert into product values('"+id+"','"+name+"','"+madeTime+"','"+price+"')";stmt.execute(sqlinsert);String sql="select * from product";ResultSet rs=stmt.executeQuery(sql);    out.print("<table border>");out.print("<tr>");out.print("<th width=100>"+"id");out.print("<th width=100>"+"name");out.print("<th width=100>"+"madeTime");out.print("<th width=100>"+"price");out.print("</tr>");while(rs.next()){out.print("<tr>");out.print("<td>"+rs.getString(1)+"</td>");out.print("<td>"+rs.getString(2)+"</td>");out.print("<td>"+rs.getString(3)+"</td>");out.print("<td>"+rs.getString(4)+"</td>");out.print("</tr>");}conn.close();}catch(SQLException e){}
?

热点排行