Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÓësql server 2005µÄÏà¹Ø²Ù×÷

//±¾³ÌÐòÁ¬½ÓµÄÊÇsql server 2005£¬ÓëÁ¬½Ósql server 2000Óе㲻ͬ£ºdriverNameºÍURL¶¼²»Í¬
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class create{
   public void getConnection() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
   {
    Statement stmt = null;
    Connection  dbConn;
    ResultSet rs;
        String user="sa";
        String pass="";
        String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        String URL = "jdbc:sqlserver://localhost:1433;DatabaseName=tempdb";
        try{
         Class.forName(driverName).newInstance();
          System.out.println("ok");
          dbConn = DriverManager.getConnection(URL,user,pass);
           System.out.println("Connection Successful!");
          stmt = dbConn.createStatement(); // »ñµÃÖ´ÐÐSQLÓïÑÔµÄÈÝÆ÷
          rs=dbConn.getMetaData().getTables(null, null, "testTb", null);
          if(rs.next()){
           System.out.println("testTb´æÔÚ!ÔÛÏÖÔÚ°ÑËüɾÁ˰ɣ¡");
           stmt.executeUpdate("drop table testTb");
              System.out.println("»ØÍ·ÔÙ¿´¿´£¬Ã»Á˰ɣ¿");
      &nb


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃæ£¬ºóÃæ ......

ä¯ÀÀLINQ to SQL¹ØÏµ

±êÇ©£ºÊý¾Ý·ÃÎÊ     LINQ     LINQ to SQL ²¿·Ö
ä¯ÀÀLINQ to SQL¹ØÏµ      Á½¸ö¹ØÁªµÄ±í£º
 & ......

SQL SERVERÒìµØ±¸·Ý·½·¨(1)

д³É´æ´¢¹ý³Ì£¬½¨Á¢×÷Òµ¶¨Ê±±¸·Ý~~~
--ÔÚsqlÖÐÓ³ÉäһϾͿÉÒÔÁË
exec master..xp_cmdshell 'net use z: \\yizhi\D$ "ÃÜÂë" /user:yizhi\administrator'
/*--˵Ã÷:
exec master..xp_cmdshell 'net use z: \\xz\c$ "ÃÜÂë" /user:xz\administrator'
z:ÊÇÓ³ÉäÍøÂç·¾¶¶ÔÓ¦±¾»úµÄÅÌ·û,ÓëÏÂÃæµÄ±¸·Ý¶ÔÓ¦
\\xz\c$ÊÇÒªÓ³ÉäµÄÍ ......

sql ¶à±í¹ØÁª²éѯ

 create database example
use example
create table major
(
 spno varchar(10) primary key not null,
 spname varchar(20) not null
 )
 create table student
(
 sno varchar(10) primary key not null,
 sname varchar(10) not null,
 ssex varchar(2) not null, ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ