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¡¢ÅäÖÃjava»·¾³£¬MyEclipse7.0¡£ÅäÖÃjboss5.0£¬Õ¹¿ªÑ¡ÔñjdkΪÒѰ²×°µÄjdk·¾¶¡£
2¡¢°²×°2005ºÍsql2000£¬×°2000ʱҪװsp4.Çý¶¯Ñ¡Ôñjdbc2.0¡£ÔÙ×°2000ʱʵÀýÃû×Ô¼ºÊäÈëÒ»¸ö¡£ÕâÀïµÄÎÊÌâ¾ÍÊǵǼÃûºÍÃÜÂëµÄÉèÖã¬ÓÒ»÷“SQL Server×é”ϵÄʵÀýÃû£¨Windows NT)"µÄ“ÊôÐÔ”£¬ÔÚµ¯³öµÄ¶Ô»°¿ò ......
ת×Ô£ºhttp://hi.baidu.com/346667002/blog/item/e58edef0d599fcc97831aa18.html
1. ActionContext
ÔÚStruts2¿ª·¢ÖÐ,³ýÁ˽«ÇëÇó²ÎÊý×Ô¶¯ÉèÖõ½ActionµÄ×Ö¶ÎÖÐ,ÎÒÃÇÍùÍùÒ²ÐèÒªÔÚActionÀïÖ±½Ó»ñÈ¡ÇëÇó(Request)»ò»á»°
(Session)µÄһЩÐÅÏ¢,ÉõÖÁÐèÒªÖ±½Ó¶ÔJavaServlet
HttpµÄÇëÇó(HttpServletRequest),ÏìÓ¦(HttpServletRes ......
set adoCN =createobject("ADODB.CONNECTION")
set strCnn =createobject("ADODB.Recordset")
set rstSchema =createobject("ADODB.Recordset")
Dim I
dim n
str1 ......
´ó¸ÅµÄ¹¦ÄܾÍÊÇÈÕÆÚÌáÐÑ£¬°ÑͨѶ¼ºÍÈÕÆÚÌáÐÑÏà½áºÏ¡£
ÌáÐÑ·½Ãæ×öµÄºÜ²î£¬¼¼ÊõÓÐÏÞ¡£
Ƥ·ôÓõÄÊÇSkin++
µÚÒ»´Î·¢£¬µ«Ö®Ç°Ð޸Ĺý¼¸´Î£¬Ä¿Ç°°æ±¾0.7
×öÕâ¸ö¶«Î÷ÍêÈ«ÊÇÒòΪÎÒ¸öÈËÐèÒª¡£
ÊÇÒ»¸ö¶àÓû§µÄ¹¤¾ß¡£
ÓÐ×Ô¶¯Éý¼¶¹¦ÄÜ¡£
Ó¦Ó÷¶Î§ºÜÕ¡£
ÏÂÔØµØÖ·£ºhttp://www.cppblog.com/Files/pencil/GoodFriendV0.7.rar
Ô ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace AddressList
{
public partial class FrmAccessUse : Form
{
public Fr ......