JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,Oracle
import java.sql.*;
/*
* JAVAÁ¬½ÓACCESS£¬SQL Server,MySQL,OracleÊý¾Ý¿â
*
* */
public class JDBC {
public static void main(String[] args)throws Exception {
Connection conn=null;
//====Á¬½ÓACCESSÊý¾Ý¿â====
//Á¬½ÓACCESS(·ÇODBCÁ¬½Óģʽ)
//String dbURL ="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=f:/db1.mdb";
//Á¬½ÓACCESS(ODBC -ϵͳDSNÁ¬½Óģʽ)
//String dbURL="jdbc:odbc:odbcName";
//conn = DriverManager.getConnection(dbURL);//´´½¨Á¬½Ó¶ÔÏó
//System.out.println("ACCESSÊý¾Ý¿âÁ¬½Ó³É¹¦£¡");
//====Á¬½ÓSQLÊý¾Ý¿â====
/*
* String dbURL="jdbc:microsoft:sqlserver://localhost:Êý¾Ý¿â¶Ë¿Ú;DatabaseName=Êý¾Ý¿âÃû";
*
* */
//String dbURL="jdbc:microsoft:sqlserver://localhost:7788;DatabaseName=msdb";
//String userName = "sa";
//String userPwd = "admin";
//Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");//¼ÓÔØÇý¶¯
//conn = DriverManager.getConnection(dbURL,userName,userPwd);//´´½¨Á¬½Ó¶ÔÏó
//System.out.println("SQLÊý¾Ý¿âÁ¬½Ó³É¹¦£¡");
//====Á¬½ÓMySQlÊý¾Ý¿â====
/*
* "jdbc:mysql://localhost/Êý¾Ý¿âÃû×Ö?user=Óû§Ãû&password=ÃÜÂë&useUnicode=true&characterEncoding=gb2312";
*
* */
//String dbURL="jdbc:mysql://localhost/hackwang?user=root&password=hackwang&useUnicode=true&characterEncoding=gb2312";
//Class.forName("org.gjt.mm.mysql.Driver");//¼ÓÔØÇý¶¯
//conn = DriverManager.getConnection(dbURL);//´´½¨Á¬½Ó¶ÔÏó
//System.out.printl
Ïà¹ØÎĵµ£º
ÊìϤSQL SERVER 2000µÄÊý¾Ý¿â¹ÜÀíÔ±¶¼ÖªµÀ£¬ÆäDTS¿ÉÒÔ½øÐÐÊý¾ÝµÄµ¼Èëµ¼³ö£¬Æäʵ£¬ÎÒÃÇÒ²¿ÉÒÔʹÓÃTransact-SQLÓï¾ä½øÐе¼Èëµ¼³ö²Ù×÷¡£ÔÚTransact-SQLÓï¾äÖУ¬ÎÒÃÇÖ÷ҪʹÓÃOpenDataSourceº¯Êý¡¢OPENROWSET º¯Êý£¬¹ØÓÚº¯ÊýµÄÏêϸ˵Ã÷£¬Çë²Î¿¼SQLÁª»ú°ïÖú¡£ÀûÓÃÏÂÊö·½·¨£¬¿ÉÒÔÊ®·ÖÈÝÒ×µØʵÏÖSQL SERVER¡¢ACCESS¡¢EXCELÊý¾Ýת»»£ ......
ýÌå½ÓÈë¿ØÖƲãµÄËõд
ʲôÊÇmac!!!
Èç¹ûÄãÊÇͨ¹ýУ԰Íø»òСÇø½ÓÈëInternet£¬ÄÇôһ¶¨Ìý˵¹ýMACµØÖ·¡£Ê²Ã´ÊÇMACµØÖ·£¬MACµØÖ·ÔÚÕâÖÖ¾ÖÓòÍø»·¾³Öо¿¾¹Æðµ½Ê²Ã´×÷Óã¿ÏÂÃæ¾ÍÀ´½éÉÜÒ»ÏÂMACµØÖ·µÄ֪ʶ£¬MACµØÖ·ºÍIPµØÖ·µÄÇø±ðÒÔ¼°MACµØÖ·ÔÚʵ¼ÊÓ¦ÓÃÖÐËùÉæ¼°µ½µÄ°²È«ÎÊÌâ¡£
¡¡¡¡Ò»¡¢»ù´¡ÖªÊ¶
¡¡¡¡Èç½ñµÄÍøÂçÊÇ·Ö²ãÀ´Êµ ......
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
·¢²¼ÈÕÆÚ : 8/8/2003 | ¸üÐÂÈÕÆÚ : 6/7/2004
Martin Tracy
Visual Studio Team
Microsoft Corporation
ÊÊÓÃÓÚ£º Microsoft® ADO.NET
Microsoft® ASP.NET
Microsoft® Visual C#® .NET
Microsoft® Visual Studio® .NET
ÕªÒª£º±¾ÑÝÁ·ËµÃ÷ÁËÈçºÎʹÓüòµ¥µÄ Visual C#® ÄÚº¬´úÂë Web Ó¦ÓÃ³Ì ......