JSPÁ¬½ÓACCESSÊý¾Ý¿âµÄ¼òµ¥´úÂë
Á¬½ÓACCESSÊý¾Ý¿âµÄ¼òµ¥JSP´úÂ룺
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ page import="java.sql.*" %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver") ;
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=" + application.getRealPath("jsp.mdb"); //ÓëJSPÎļþͬһĿ¼ÏµÄACCESSÊý¾Ý¿âÎļþÃû£ºjsp.mdb
Connection conn = DriverManager.getConnection(url,"",""); //Á¬½ÓACCESSÊý¾Ý¿â£¨url,"Óû§Ãû","ÃÜÂë"),Ϊ¿Õ¼´Ã»ÓÐÉèÖÃÊý¾ÝµÄµÇ¼ÃÜÂë¡£
Statement stmt=conn.createStatement();
String sql="select * from login"; //¹¹ÔìSQLÓï¾ä
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
int id=rs.getInt("id"); //µÃµ½Êý¾Ý¿âÀïÃæµÄ×Ö¶ÎidµÄÖµ¡£
String username=rs.getString("username"); //µÃµ½Êý¾Ý¿âÀïÃæµÄ×Ö¶ÎusernameµÄÖµ¡£
String password=rs.getString("password");
}
//¹Ø±ÕÓëÊý¾Ý¿âµÄÁ¬½Ó
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
e.printStackTrace();
}
%>
</table>
</center>
<html>
<head>
<title>Á¬½ÓÊý¾Ý¿â</title>
</head>
<body>
</body>
</html>
Ïà¹ØÎĵµ£º
1¡¢ÈçºÎÏÔʾĿ¼ÁÐ±í£º
ÎÒÃÇÔÚ±¾»ú²âÊÔ³ÌÐòʱ£¬Ò»°ã¶¼Ï°¹ßÔÚä¯ÀÀÆ÷ÖоÍÄܱéÀúµ½Ä³¸öĿ¼Ï¶¼ÓÐÄÄЩÎļþ£¬Õâ¾ÍÐèÒªweb·þÎñÆ÷Ö§³ÖĿ¼ÁÐ±í£º
´ò¿ªÎļþconf/web.xml£¬ÕÒµ½ÒÔÏ´úÂ룺
<param-name>listings</param-name>
<param-value>false</param-value>
½«ÆäÖеÄfalse¸Ä³Étrue
2¡¢ÅäÖÃerror-p ......
Double action
fingerprint
and access code security door lock for your home,
office or small business. Get modern biometric security at your entry point with
this standard door handle style double action doorlock.
This is the most secure and convenient method in assuring only authorized peo ......
JSPÓï·¨Ïê½â[תÌû]
HTML×¢ÊÍ:
1) ¿ÉÒÔÓÃ×¢ÊÍÄÚÈÝ,Ò²¿ÉÒÔÓñí´ïʽ.
2)Òþ²Ø×¢ÊÍ:
×¢Êͻᱠ......
̽Ë÷Èí¼þ¹¤×÷ÊÒ³¤ÆÚרҵ³Ð½ÓÖÐСÐÍÉÌÒµÈí¼þ»òÍøÕ¾£¬×îÓŻݵļ۸ñºÍ¸ßÖÊÁ¿µÄ·þÎñÆÚ´ýÄúµÄ»Ý¹Ë£¡
±¾¹¤×÷ÊÒ³Ð½Ó JSP ASP VB PB LotusNotes µÈÓïÑÔÒªÇóµÄÓ¦ÓÃϵͳ¿ª·¢ÒµÎñ
java jspʵսԴ³ÌÐò´úÂë:
......
string sql = "select a.orderId,a.UserName,b.CodeValue as Delivery ,a.DeliveryAddress,a.PhoneNum,c.CodeValue as Payment,d.CodeValue as OrderStatus,d.CodeValue as OrderStatusID,a.OrderTime,a.Merchant from (( m_Order a ";
sql += " left j ......