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

SQL Server JDBC Deriver Problems

If the SQL data type is 'timestamp', we need to use ResultSet.getBytes() to retrieve its value. If the SQL data type is 'datetime', we can use ResultSet.getTimestamp(). It is said timestamp is interanlly saved as binary data.
  try {
     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
     Connection conn = DriverManager.getConnection
            ("jdbc:sqlserver://<url_address>;user=<user>;password=<password>;database=<database>");
     Statement statement = conn.createStatement
            (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
     ResultSet rs = statement.executeQuery("...");
     while (rs.next()) {
         System.out.println(rs.getTimestamp(1));
      }
  } catch (Exception e) {
      e.printStackTrace();
  }


Ïà¹ØÎĵµ£º

SQL Server´æ´¢¹ý³Ì½éÉÜ


ÕªÒª£º±¾ÎĽéÉÜÁËSQL Server´æ´¢¹ý³ÌÏà¶ÔÓÚÆäËûµÄÊý¾Ý¿â·ÃÎÊ·½·¨µÄÓŵ㼰SQL Server´æ´¢¹ý³ÌµÄ·ÖÀàµÈ¡£
SQL Server´æ´¢¹ý³ÌÊÇÒ»¸ö±»ÃüÃûµÄ´æ´¢ÔÚ·þÎñÆ÷ÉϵÄTransacation-SqlÓï¾ä¼¯ºÏ,ÊÇ·â×°Öظ´ÐÔ¹¤×÷µÄÒ»ÖÖ·½·¨,ËüÖ§³ÖÓû§ÉùÃ÷µÄ±äÁ¿¡¢Ìõ¼þÖ´ÐкÍÆäËûÇ¿´óµÄ±à³Ì¹¦ÄÜ¡£
SQL Server´æ´¢¹ý³ÌÏà¶ÔÓÚÆäËûµÄÊý¾Ý¿â·ÃÎÊ·½·¨Ó ......

SQLͨÅä·û¼°Ä£Ê½Æ¥Åä

Ç°Ìá,MS SQLµÄͨÅä·ûº¬Ò壺
ÐòºÅ
ͨÅä·û
º¬Òå
ʾÀý
1
%
°üº¬Áã¸ö»ò¶à¸ö×Ö·ûµÄÈÎÒâ×Ö·û´®¡£ 
WHERE title LIKE '%computer%' ½«²éÕÒÔÚÊéÃûÖÐÈÎÒâλÖðüº¬µ¥´Ê"computer" µÄËùÓÐÊéÃû¡£
2
_
Èκε¥¸ö×Ö·û¡£
WHERE au_fname LIKE '_ean' ½«²éÕÒÒÔ ean ½áβµÄËùÓÐ 4 ¸ö×ÖĸµÄÃû×Ö£¨Dean¡¢Sean µÈ£©¡£
3
[ ] ......

SQL Server 2008ÐÐÊý¾ÝºÍÒ³Êý¾ÝѹËõ½âÃÜ

SQL ServerµÄÐÔÄÜÖ÷Ҫȡ¾öÓÚ´ÅÅÌI/OЧÂÊ£¬Ìá¸ßI/OЧÂÊijÖÖ³ÌÐòÉϾÍÒâζ×ÅÌá¸ßÐÔÄÜ¡£SQL Server 2008ÌṩÁËÊý¾ÝѹËõ¹¦ÄÜÀ´Ìá¸ß´ÅÅÌI/O¡£
Êý¾ÝѹËõÒâζ׿õСÊý¾ÝµÄÓдÅÅÌÕ¼ÓÃÁ¿£¬ËùÒÔÊý¾ÝѹËõ¿ÉÒÔÓÃÔÚ±í£¬¾Û¼¯Ë÷Òý£¬·Ç¾Û¼¯Ë÷Òý£¬ÊÓͼË÷Òý»òÊÇ·ÖÇø±í£¬·ÖÇøË÷ÒýÉÏ¡£
Êý¾ÝѹËõ¿ÉÒÔÔÚÁ½¸ö¼¶±ðÉÏʵÏÖ£ºÐ춱ðºÍÒ³¼¶±ð¡£Ò³¼¶±ðѹ ......

SQLÓï¾ä´´½¨Êý¾Ý¿â

1.create database dataname
ÕâÊÇ´´½¨Êý¾Ý¿â×î¼òµ¥µÄ·½·¨£®Êý¾Ý¿âµÄ¸÷¸öÊôÐÔ¶¼ÊÇĬÈÏ£®ÈçÊý¾Ý¿âÎļþÓëÈÕÖ¾Îļþ´æ´¢Ä¿Â¼£®Êý¾Ý¿â´óСµÈ£®
ÏÂÃæ½éÉÜϳ£Óþö¶¨Êý¾Ý¿âÊôÐÔµÄ×Ӿ䣮
on:¼òµ¥Àí½âΪ¶¨Òå´æ´¢Êý¾Ý¿âÎļþµÄλÖ㬿´ÏÂÃæ´úÂ룮
filename:Êý¾Ý¿âµÄÂß¼­±ðÃû
size:Êý¾Ý¿â³õʼ´óС
maxsize:Êý¾Ý¿â³õ´óÈÝÁ¿
fil ......

ÈçºÎÕÒµ½sql serverÊý¾Ý¿âÖеÄËÀËø?


¼ì²âËÀËø
Èç¹û·¢ÉúËÀËøÁË£¬ÎÒÃÇÔõôȥ¼ì²â¾ßÌå·¢ÉúËÀËøµÄÊÇÄÄÌõSQLÓï¾ä»ò´æ´¢¹ý³Ì£¿
ÕâʱÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ´洢¹ý³ÌÀ´¼ì²â£¬¾Í¿ÉÒÔ²é³öÒýÆðËÀËøµÄ½ø³ÌºÍSQLÓï¾ä¡£SQL Server×Ô´øµÄϵͳ´æ´¢¹ý³Ìsp_whoºÍsp_lockÒ²¿ÉÒÔÓÃÀ´²éÕÒ×èÈûºÍËÀËø, µ«Ã»ÓÐÕâÀï½éÉܵķ½·¨ºÃÓá£
use master
go
create procedure s ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ