jdbcÓëSQLserverÁ¬½Ó
package com.tongying.www.until;
public class Resource {
// MySQlÊý¾Ý¿âµÄ×ÊÔ´
/* public static final String DRIVER="com.mysql.jdbc.Driver";
public static final String URL="jdbc:mysql://localhost:3306/msg";
public static final String USER="root";
public static final String PASSWORD ="root";
*/
//MSSQL
public static final String DRIVER="com.microsoft.jdbc.sqlserver.SQLServerDriver";
public static final String URL="jdbc:microsoft:sqlserver://localhost:1433;DataBaseName=student";
public static final String USER="sa";
public static final String PASSWORD ="sa";
}
package com.tongying.www.test;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import com.tongying.www.until.Resource;
public class Test1 {
public static void main(String[]args){
Test1 test=new Test1();
test.Query();
}
//Á¬½ÓÊý¾Ý¿â
public void Query(){
Connection conn=null;
Statement stmte=null;
ResultSet res=null;
&n
Ïà¹ØÎÊ´ð£º
´úÂ룺
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
con= DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost: ......
»¹ÔµÄ±¨´íÐÅÏ¢:
System.Data.SqlClient.SqlError: ±¸·Ý¼¯ÖеÄÊý¾Ý¿â±¸·ÝÓëÏÖÓÐµÄ 'chat_Data' Êý¾Ý¿â²»Í¬¡£ (Microsoft.SqlServer.Smo)
Çë¸÷λ¸ßÊÖ°ïæ½â¾ö
»¹ÔµÄÊý¾Ý¿âÃû×ÖÓ뱸·ÝµÄÊ ......
±ÈÈç ´«½øÀ´µÄ×Ö·û´®ÊÇ ¡®12/sep/2009 12£º52£º20¡¯ Ö±½ÓÓÃcast»á±¨´í¡£
¶øÇÒÖмäµÄÔ·ÝÒ²²»¹Ì¶¨ ¡£Ôõôת»»³ÉÈÕÆÚÐ͵ÄÄØ
ÓÃÒ»¸ö±í¼Ç¼1-12Ô·ݣ¡
Ö±½Óת»»ÊDz»ÐÐÁË ²ð·Ö ³öÔÂÀ´ÅжÏÁË
¡®12/sep/2009 12£º ......
ÎÒµÄÊý¾Ý¿âͻȻ±¨Ò»¸öºÜÓôÃÆµÄ´íÎ󣬵¼ÖÂÊý¾ÝÎÞ·¨²é¿´£¬
´íÎóÌáʾΪ£º
ÔÚÎļþ 'G:\data\ÆóÒµ¹ÜÀíÊý¾Ý¿â1_data.n ......
´ó¼ÒÓÐûÓÐ ´æ´¢¹ý³Ì·ÖÒ³µÄÀý×Ó£¬¹²Ïíһϣ¬Ð»Ð»£¡£¡£¡
http://wyf.javaeye.com/blog/462396
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
/*--ʵÏÖ·ÖÒ³µÄͨÓô洢¹ý³Ì
......