JSP²éѯÊý¾Ý¿â²¢ÏÔʾ½á¹ûµÄ³ÌÐò
Ò»¡¢jspÁ¬½ÓOracle8/8i/9iÊý¾Ý¿â£¨ÓÃthinģʽ£©
testoracle.jspÈçÏ£º
< %@ page contentType= "text/html;charset=gb2312 "% >
< %@ page import= "java.sql.* "% >
< html >
< body >
< %Class.forName( "oracle.jdbc.driver.OracleDriver ").newInstance();
String url= "jdbc:oracle:thin:@localhost:1521:orcl ";
//orclΪÄãµÄÊý¾Ý¿âµÄSID
String user= "scott ";
String password= "tiger ";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql= "select * from test ";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()) {% >
ÄúµÄµÚÒ»¸ö×Ö¶ÎÄÚÈÝΪ£º < %=rs.getString(1)% >
ÄúµÄµÚ¶þ¸ö×Ö¶ÎÄÚÈÝΪ£º < %=rs.getString(2)% >
< %}% >
< %out.print( "Êý¾Ý¿â²Ù×÷³É¹¦£¬¹§Ï²Äã ");% >
< %rs.close();
stmt.close();
conn.close();
% >
< /body >
< /html >
¶þ¡¢jspÁ¬½ÓSql Server7.0/2000Êý¾Ý¿â
testsqlserver.jspÈçÏ£º
< %@ page contentType= "text/html;charset=gb2312 "% >
< %@ page import= "java.sql.* "% >
< html >
< body >
< %Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver ").newInstance();
String url= "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs ";
//pubsΪÄãµÄÊý¾Ý¿âµÄ
String use
Ïà¹ØÎĵµ£º
JAVA×ÛºÏÃæÊÔÌâ£ºÒ³ÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³ÃæÕ¹Ê¾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ãæ£¬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......
»·¾³£ºAjax+JSP£¬Tomcat5.05
²Î¿¼£ºhttp://www.w3cschool.cn/index-24.asp.htm
Îļþ£ºtestAjax.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb ......
ʹÓÃdiasplaytag×é¼þ¡£
ʹÓÃmysql5, ÓиöÊý¾Ý±íuser,×Ö¶ÎÓÐid, username, password¡£
ʹÓÃdisplaytagÐèµ¼Èëdisplaytag-1.1.jar£¬ºÍ
commons-logging
commons-lang
commons-collections
commons-beanutils
log4j
itext (optional, for pdf/rtf export)
È»ºóÔÚJSPÒ³ÃæÖзÅÈë<%@ taglib uri="http://display ......
ÏîÄ¿¿ò¼ÜS2SH,jspÒ³ÃæÈçÏ£¬selectÁбíÉèΪmultiple¡£ÎªÁËÄÜÔÚactionÀïÈ¡µ½Ç°Ì¨½çÃæselectÁбíµÄ¶àѡֵ£¬Ï¹¸ãÁËÁ½Ì죬½ñÌìÖÕÓڳɹ¦¡£Æäʵºǫ́actionȡǰ̨jspÒ³ÃæµÄÖµºÜ¼òµ¥£¬·Ï»°²»¶à˵£¬ÏÈÌù´úÂ룺
<body>
<form action="sendMsg.action?senderId=${users.id }&username=${users.username}" m ......
´ËÖÖ·½·¨Ê¹ÓÃexcelµÄ×é¼þ£¬ÒªÇó¿Í»§¶Ë±ØÐë×°ÓÐexcel³ÌÐò¡£·½·¨Êǽ«±í¸ñÖеÄÿ¸ötd±êÇ©µÄÄÚÈÝÈ¡³ö£¬×÷ΪexcelÎļþÖÐÒ»¸öµ¥Ôª¸ñµÄÄÚÈÝ¡£
1¡¢ÔÚÍøÒ³ÖÐÌí¼Ójava½Å±¾
function AutomateExcel(tableid,unusecolumn)
{
// »ñÈ¡excel×é¼þ
var oXL = new ActiveXObject("Excel.Application");
// ......