本文目录一览

1,MySQL与PHP的连接语句类型

PHP与MYSQL数据库连接语句 mysql_connect(”localhost”, “username”, “password”) 数据库选择 mysql_select_db(”test”)

MySQL与PHP的连接语句类型

2,net数据库连接语句

1、创建一个连接数据库的对象:Conn 2、定义一个字符串ConnString ,赋值就是******包含连接的服务器、数据库、用户民、密码、等等3、把连接数据库的字符串赋给数据库连接对象的ConnectionString 属性。其实三句可以合并一句SqlConnection Conn=new SqlConnection( "***********");

net数据库连接语句

3,在SQLserver中的连接语句

外部连接和自联接 inner join(等值连接) 只返回两个表中联结字段相等的行; left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录; right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录; on 指定表间联结字段及其关系的等号 "=" 表达式, 返回 true 或 false. 当表达式返回 true 时, 则查询中包含该记录.; ! 外部连接只能操作已存在于数据库中的数据
分左外、右外、内外、内连接几种, left inner join /right inner join / full inner join/ inner join 具体怎么 用你只要自己创建两个表就能看到效果和区别了

在SQLserver中的连接语句

4,连接数据库有哪几种方法分别写出相应的语句并比较其异同点

1、Oracle8/8i/9i数据库(thin模式) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbc:oracle:thin:@localhost:1521:orcl"; //orcl为数据库的SID String user="test"; String password="test"; Connection conn= DriverManager.getConnection(url,user,password); 2、DB2数据库 Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance(); String url="jdbc:db2://localhost:5000/sample"; //sample为你的数据库名 String user="admin"; String password=""; Connection conn= DriverManager.getConnection(url,user,password); 3、Sql Server7.0/2000数据库 Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb"; //mydb为数据库 String user="sa"; String password=""; Connection conn= DriverManager.getConnection(url,user,password); 4、Sybase数据库 Class.forName("com.sybase.jdbc.SybDriver").newInstance(); String url =" jdbc:sybase:Tds:localhost:5007/myDB"; //myDB为你的数据库名 Properties sysProps = System.getProperties(); SysProps.put("user","userid"); SysProps.put("password","user_password"); Connection conn= DriverManager.getConnection(url, SysProps); 5、Informix数据库 Class.forName("com.informix.jdbc.IfxDriver").newInstance(); String url = "jdbc:informix-sqli://123.45.67.89:1533/myDB:INFORMIXSERVER=myserver; user=testuser;password=testpassword"; //myDB为数据库名 Connection conn= DriverManager.getConnection(url); 6、MySQL数据库 Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url ="jdbc:mysql://localhost/myDB?user=soft&password=soft1234&useUnicod e=true&characterEncoding=8859_1" //myDB为数据库名 Connection conn= DriverManager.getConnection(url); 7、PostgreSQL数据库 Class.forName("org.postgresql.Driver").newInstance(); String url ="jdbc:postgresql://localhost/myDB" //myDB为数据库名 String user="myuser"; String password="mypassword"; Connection conn= DriverManager.getConnection(url,user,password);
我现在用的是这种方法 dim db,Conn,ConnStr db="data.mdb" set conn=Server.CreateObject("ADODB.Connection") ConnStr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(db) conn.open ConnStr

文章TAG:数据  数据库  对接  语句  数据库对接语句有哪些类型  
下一篇