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>
Ïà¹ØÎĵµ£º
Take Equity Collection System as an example, Some other office collegues want to access it from home without VPN, The way to check is:
1. Check if it's limited in network, this needs to confirm with network people
2. If the step 1 passed, get the external IP address of the system, map ......
ÔÚΪ·þÎñÆ÷¶Ë×é¼þ±à³Ìʱ£¬ÄãºÜ¿ÉÄÜÒª´ÓÏà¶ÔÓÚweb¸ùµÄ·¾¶À´È¡µÃij¸öÎļþµÄÕæʵ·¾¶£¬µ«´ËÎļþʵ¼ÊÉÏÔÚÕ¾µãµÄÒ»¸öÐéÄâ·¾¶ÉÏ¡£
ʲôÊÇÐéÄâ·¾¶£¿
ÔÚÒ»¸öweb·þÎñÆ÷ÉÏ£¬ÐéÄâ·¾¶½«ÎïÀíÉÏ·ÖÀëµÄ¸÷Îļþ×éºÏÔÚÒ»Æ𣬷ÅÔÚͬһ¸öÕ¾µã·¾¶ÉÏ£¬ÔÚÓ¦Ó÷þÎñÆ÷ÉÏ£¬Ã¿¸öÓ¦Óö¨Î»ÓÚÆä×Ô¼ºµÄÐéÄâ·¾¶ÉÏ£¬Êµ¼ÊÉÏÏ໥֮¼äÓÐ×ÅÍêÃÀµØ·ÖÀë¡£ ......
private const string ACCESS_UPDATE_ADMIN_PASSWORD = "UPDATE [Admins] SET admin_pass=@adminPass WHERE admin_name=@adminName";
dbInstance.SetParameters("@adminPass", _adminDObj.Admin_Password);
dbInstance.SetParameters("@adminName", _adminDObj.Admin_Name);
²ÎÊýµÄ˳Ðò±ØÐëºÍSQLµÄ˳ÐòÒ»Ö±£¬·ñÔòÎÞ·¨¸ ......
̽Ë÷Èí¼þ¹¤×÷ÊÒ³¤ÆÚרҵ³Ð½ÓÖÐСÐÍÉÌÒµÈí¼þ»òÍøÕ¾£¬×îÓŻݵļ۸ñºÍ¸ßÖÊÁ¿µÄ·þÎñÆÚ´ýÄúµÄ»Ý¹Ë£¡
±¾¹¤×÷ÊÒ³Ð½Ó JSP ASP VB PB LotusNotes µÈÓïÑÔÒªÇóµÄÓ¦ÓÃϵͳ¿ª·¢ÒµÎñ
java jspʵսԴ³ÌÐò´úÂë:
......
1. JRE °²裝 (¿É從 http://java.sun.com/ÏÂ載)
Java SE Runtime Environment (JRE) JRE 6 Update 17
2. JDK°²裝 (¿É從 http://java.sun.com/ÏÂ載)
Java SE ......