锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av成人中文无码专区,亚洲精品在线观看视频,亚洲视频手机在线http://m.tkk7.com/dashi99/category/37394.html<div align="center"> <img height="50" width="200" name="welcome" src="http://m.tkk7.com/images/blogjava_net/majianan/14891/r_5858488902000cu2.gif"/> </div> <br/> <center><font size=4 >楸肩涓嶅紑姘?浣嗘槸娌℃湁璇翠笉紱誨紑鍝淮姘?</font></center>zh-cnWed, 15 Aug 2012 08:57:31 GMTWed, 15 Aug 2012 08:57:31 GMT60How to insert multiple record into DB with store procedure?http://m.tkk7.com/dashi99/archive/2012/08/13/385403.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Mon, 13 Aug 2012 08:17:00 GMThttp://m.tkk7.com/dashi99/archive/2012/08/13/385403.htmlhttp://m.tkk7.com/dashi99/comments/385403.htmlhttp://m.tkk7.com/dashi99/archive/2012/08/13/385403.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/385403.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/385403.html

1.        1.Define the object type PROFILE_TAG_TYPE.

CREATE OR REPLACE TYPE PZN_ADMIN.PROFILE_TAG_TYPE

AS

 OBJECT

 (

    MID                     VARCHAR2 (34),

    TAG_ID                  NUMBER,

    CUSTOMER_TYPE           VARCHAR2(1),

    SOURCE_SYSTEM           VARCHAR2(30),

    TAG_CREATED_DATE        VARCHAR2(30),

    INTEREST_LEVEL          NUMBER(2),

    SUPPRESSION_IND         VARCHAR2(2),

    SUPPRESSION_EXPIRY_DATE VARCHAR2(30),

    LAST_HOUSEKEEPING_DATE VARCHAR2(30),

    LAST_EVENT_DATE         VARCHAR2(30),

REASON                  VARCHAR2(1500) );

 

2.       2. Grant PROFILE_TAG_TYPE execute access to PZN_MB_USER.

GRANT EXECUTE ON PZN_ADMIN.PROFILE_TAG_TYPE TO PZN_MB_USER;

 

3.       3. Define the array type reference to object PROFILE_TAG_TYPE.

CREATE TYPE PZN_ADMIN.PROFILE_TAG_ARRAY AS TABLE OF PZN_ADMIN.PROFILE_TAG_TYPE;

 

4.       4. Grant PROFILE_TAG_ARRAY execute access to PZN_MB_USER.

GRANT EXECUTE ON PZN_ADMIN.PROFILE_TAG_ARRAY TO PZN_MB_USER;

 

5.       5. Create store procedure package.

CREATE OR REPLACE

PACKAGE PZN_ADMIN.PZN_PROFILE_TAG_PKG

AS

PROCEDURE INSERT_PROFILE_TAG(

    PTA PROFILE_TAG_ARRAY);

END PZN_PROFILE_TAG_PKG;

 

6.       6. Create store procedure package body.

CREATE OR REPLACE

PACKAGE BODY PZN_ADMIN.PZN_PROFILE_TAG_PKG

AS

PROCEDURE INSERT_PROFILE_TAG(

    PTA PROFILE_TAG_ARRAY)

AS

BEGIN

 FOR I IN PTA.FIRST..PTA.LAST

 LOOP

    INSERT

    INTO PZN_ADMIN.PROFILE_TAG

      (

        PROFILE_TAG_ID,

        MID,

        TAG_ID,

        CUSTOMER_TYPE,

        SOURCE_SYSTEM,

        TAG_CREATED_DATE,

        INTEREST_LEVEL,

        SUPPRESSION_IND,

        SUPPRESSION_EXPIRY_DATE,

        LAST_HOUSEKEEPING_DATE,

        LAST_EVENT_DATE,

        REASON

      )

      VALUES

      (

        SEQ_PROFILE_TAG_ID.NEXTVAL ,

        PTA(I).MID,

        PTA(I).TAG_ID,

        PTA(I).CUSTOMER_TYPE,

        PTA(I).SOURCE_SYSTEM,

        TO_DATE(PTA(I).TAG_CREATED_DATE,'YYYY-MM-DD'),

        PTA(I).INTEREST_LEVEL,

        PTA(I).SUPPRESSION_IND,

        TO_DATE(PTA(I).SUPPRESSION_EXPIRY_DATE,'YYYY-MM-DD'),

        TO_DATE(PTA(I).LAST_HOUSEKEEPING_DATE,'YYYY-MM-DD'),

        TO_DATE(PTA(I).LAST_EVENT_DATE,'YYYY-MM-DD'),

        PTA(I).REASON

      );

 END LOOP;

END INSERT_PROFILE_TAG;

END PZN_PROFILE_TAG_PKG;

 

7.       7. Create synonym to PZN_MB_USER.

CREATE SYNONYM PZN_MB_USER.PZN_PROFILE_TAG_PKG FOR PZN_ADMIN.PZN_PROFILE_TAG_PKG;

 

8.       8. Grant execute access to PZN_MB_USER.

GRANT EXECUTE ON PZN_ADMIN.PZN_PROFILE_TAG_PKG TO PZN_MB_USER;

 

9.       9. Create the java class to call the procedure.

 

public class ProcedureTest2 {

 

        public static void insertProfileTag(){

                        Connection dbConn = null;

                        try {

                                        Object[] so1 = {"ee745b5782bfc311e0b5730a2aba15aa77",31,"C","eDB","2012-08-13",0,"0","2012-08-13","2012-08-13","2012-08-13","eDB"};

                                        Object[] so2 = {"ee745b5782bfc311e0b5730a2aba15aa77",32,"C","eDB","2012-08-13",0,"0","2012-08-13","2012-08-13","2012-08-13","eDB"};

                                        OracleCallableStatement callStatement = null;

                                        Class.forName("oracle.jdbc.driver.OracleDriver");

                                        dbConn = DriverManager.getConnection("jdbc:oracle:thin:@da957116.fmr.com:1521:orcl", "PZN_MB_USER", "PZN_MB_USER123");

                                       

                                        StructDescriptor st = new StructDescriptor("PZN_ADMIN.PROFILE_TAG_TYPE", dbConn);

                                        STRUCT s1 = new STRUCT(st, dbConn, so1);

                                        STRUCT s2 = new STRUCT(st, dbConn, so2);

                                        STRUCT[] deptArray = { s1, s2 };

                                       

                                        ArrayDescriptor arrayDept = ArrayDescriptor.createDescriptor("PZN_ADMIN.PROFILE_TAG_ARRAY", dbConn);

                                        ARRAY deptArrayObject = new ARRAY(arrayDept, dbConn, deptArray);

                                       

                                        callStatement = (OracleCallableStatement) dbConn.prepareCall("{call PZN_PROFILE_TAG_PKG.INSERT_PROFILE_TAG(?)}");

                                        callStatement.setArray(1, deptArrayObject);

                                        callStatement.executeUpdate();

                                        dbConn.commit();

                                        callStatement.close();

                        } catch (Exception e) {

                                        System.out.println(e.toString());

                                        e.printStackTrace();

                        }

        }

 

        public static void main(String[] args) {

                        insertProfileTag();

        }

}



銈炴矇榛樻槸閲戙倿 2012-08-13 16:17 鍙戣〃璇勮
]]>
DML銆丏DL銆丏CL鍖哄埆 .http://m.tkk7.com/dashi99/archive/2012/07/17/383307.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Tue, 17 Jul 2012 06:25:00 GMThttp://m.tkk7.com/dashi99/archive/2012/07/17/383307.htmlhttp://m.tkk7.com/dashi99/comments/383307.htmlhttp://m.tkk7.com/dashi99/archive/2012/07/17/383307.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/383307.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/383307.html鎬諱綋瑙i噴錛?br />DML錛坉ata manipulation language錛夛細(xì)
       瀹冧滑鏄疭ELECT銆乁PDATE銆両NSERT銆丏ELETE錛屽氨璞″畠鐨勫悕瀛椾竴鏍鳳紝榪?鏉″懡浠ゆ槸鐢ㄦ潵瀵規(guī)暟鎹簱閲岀殑鏁版嵁榪涜鎿嶄綔鐨勮璦
DDL錛坉ata definition language錛夛細(xì)
       DDL姣擠ML瑕佸錛屼富瑕佺殑鍛戒護(hù)鏈塁REATE銆丄LTER銆丏ROP絳夛紝DDL涓昏鏄敤鍦ㄥ畾涔夋垨鏀瑰彉琛紙TABLE錛夌殑緇撴瀯錛屾暟鎹被鍨嬶紝琛ㄤ箣闂寸殑閾炬帴鍜岀害鏉熺瓑鍒濆鍖栧伐浣滀笂錛屼粬浠ぇ澶氬湪寤虹珛琛ㄦ椂浣跨敤
DCL錛圖ata Control Language錛夛細(xì)
       鏄暟鎹簱鎺у埗鍔熻兘銆傛槸鐢ㄦ潵璁劇疆鎴栨洿鏀規(guī)暟鎹簱鐢ㄦ埛鎴栬鑹叉潈闄愮殑璇彞錛屽寘鎷紙grant,deny,revoke絳夛級(jí)璇彞銆傚湪榛樿鐘舵佷笅錛屽彧鏈塻ysadmin,dbcreator,db_owner鎴杁b_securityadmin絳変漢鍛樻墠鏈夋潈鍔涙墽琛孌CL

璇︾粏瑙i噴錛?br />涓銆丏DL is Data Definition Language statements. Some examples:鏁版嵁瀹氫箟璇█錛岀敤浜庡畾涔夊拰綆$悊 SQL 鏁版嵁搴撲腑鐨勬墍鏈夊璞$殑璇█
      1.CREATE - to create objects in the database   鍒涘緩
      2.ALTER - alters the structure of the database   淇敼
      3.DROP - delete objects from the database   鍒犻櫎
      4.TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
      TRUNCATE TABLE [Table Name]銆?
銆銆涓嬮潰鏄Truncate璇彞鍦∕SSQLServer2000涓敤娉曞拰鍘熺悊鐨勮鏄庯細(xì)
銆銆Truncate table 琛ㄥ悕 閫熷害蹇?鑰屼笖鏁堢巼楂?鍥犱負(fù):
銆銆TRUNCATE TABLE 鍦ㄥ姛鑳戒笂涓庝笉甯?WHERE 瀛愬彞鐨?DELETE 璇彞鐩稿悓錛氫簩鑰呭潎鍒犻櫎琛ㄤ腑鐨勫叏閮ㄨ銆備絾 TRUNCATE TABLE 姣?DELETE 閫熷害蹇紝涓斾嬌鐢ㄧ殑緋葷粺鍜屼簨鍔℃棩蹇楄祫婧愬皯銆?
銆銆DELETE 璇彞姣忔鍒犻櫎涓琛岋紝騫跺湪浜嬪姟鏃ュ織涓負(fù)鎵鍒犻櫎鐨勬瘡琛岃褰曚竴欏廣俆RUNCATE TABLE 閫氳繃閲婃斁瀛樺偍琛ㄦ暟鎹墍鐢ㄧ殑鏁版嵁欏墊潵鍒犻櫎鏁版嵁錛屽茍涓斿彧鍦ㄤ簨鍔℃棩蹇椾腑璁板綍欏電殑閲婃斁銆?
銆銆TRUNCATE TABLE 鍒犻櫎琛ㄤ腑鐨勬墍鏈夎錛屼絾琛ㄧ粨鏋勫強(qiáng)鍏跺垪銆佺害鏉熴佺儲(chǔ)寮曠瓑淇濇寔涓嶅彉銆傛柊琛屾爣璇嗘墍鐢ㄧ殑璁℃暟鍊奸噸緗負(fù)璇ュ垪鐨勭瀛愩傚鏋滄兂淇濈暀鏍囪瘑璁℃暟鍊鹼紝璇鋒敼鐢?DELETE銆傚鏋滆鍒犻櫎琛ㄥ畾涔夊強(qiáng)鍏舵暟鎹紝璇蜂嬌鐢?DROP TABLE 璇彞銆?
銆銆瀵逛簬鐢?FOREIGN KEY 綰︽潫寮曠敤鐨勮〃錛屼笉鑳戒嬌鐢?TRUNCATE TABLE錛岃屽簲浣跨敤涓嶅甫 WHERE 瀛愬彞鐨?DELETE 璇彞銆傜敱浜?TRUNCATE TABLE 涓嶈褰曞湪鏃ュ織涓紝鎵浠ュ畠涓嶈兘嬋媧昏Е鍙戝櫒銆?
銆銆TRUNCATE TABLE 涓嶈兘鐢ㄤ簬鍙備笌浜?jiǎn)鐑?chǔ)寮曡鍥劇殑琛ㄣ?
       5.COMMENT - add comments to the data dictionary 娉ㄩ噴
       6.GRANT - gives user's access privileges to database 鎺堟潈
       7.REVOKE - withdraw access privileges given with the GRANT command   鏀跺洖宸茬粡鎺堜簣鐨勬潈闄?/p>

浜屻丏ML is Data Manipulation Language statements. Some examples:鏁版嵁鎿嶄綔璇█錛孲QL涓鐞嗘暟鎹瓑鎿嶄綔緇熺О涓烘暟鎹搷綰佃璦
       1.SELECT - retrieve data from the a database           鏌ヨ
       2.INSERT - insert data into a table                    娣誨姞
        3.UPDATE - updates existing data within a table    鏇存柊
       4.DELETE - deletes all records from a table, the space for the records remain   鍒犻櫎
       5.CALL - call a PL/SQL or Java subprogram
       6.EXPLAIN PLAN - explain access path to data
       Oracle RDBMS鎵ц姣忎竴鏉QL璇彞錛岄兘蹇呴』緇忚繃Oracle浼樺寲鍣ㄧ殑璇勪及銆傛墍浠ワ紝浜?jiǎn)瑙d紭鍖栧櫒鏄浣曢夋嫨(鎼滅儲(chǔ))璺緞浠ュ強(qiáng)绱㈠紩鏄浣曡浣跨敤鐨勶紝瀵逛紭鍖朣QL璇彞鏈夊緢澶х殑甯姪銆侲xplain鍙互鐢ㄦ潵榪呴熸柟渚垮湴鏌ュ嚭瀵逛簬緇欏畾SQL璇彞涓殑鏌ヨ鏁版嵁鏄浣曞緱鍒扮殑鍗蟲悳绱㈣礬寰?鎴戜滑閫氬父縐頒負(fù)Access Path)銆備粠鑰屼嬌鎴戜滑閫夋嫨鏈浼樼殑鏌ヨ鏂瑰紡杈懼埌鏈澶х殑浼樺寲鏁堟灉銆?
       7.LOCK TABLE - control concurrency 閿侊紝鐢ㄤ簬鎺у埗騫跺彂

涓夈丏CL is Data Control Language statements. Some examples:鏁版嵁鎺у埗璇█錛岀敤鏉ユ巿浜堟垨鍥炴敹璁塊棶鏁版嵁搴撶殑鏌愮鐗規(guī)潈錛屽茍鎺у埗鏁版嵁搴撴搷綰典簨鍔″彂鐢熺殑鏃墮棿鍙?qiáng)鏁堟灉锛屽?guī)暟鎹簱瀹炶鐩戣絳?
       1.COMMIT - save work done 鎻愪氦
        2.SAVEPOINT - identify a point in a transaction to which you can later roll back 淇濆瓨鐐?
       3.ROLLBACK - restore database to original since the last COMMIT   鍥炴粴
       4.SET TRANSACTION - Change transaction options like what rollback segment to use   璁劇疆褰撳墠浜嬪姟鐨勭壒鎬э紝瀹冨鍚庨潰鐨勪簨鍔℃病鏈夊獎(jiǎng)鍝嶏紟



銈炴矇榛樻槸閲戙倿 2012-07-17 14:25 鍙戣〃璇勮
]]>
SET DEFINE OFFhttp://m.tkk7.com/dashi99/archive/2012/07/17/383306.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Tue, 17 Jul 2012 06:22:00 GMThttp://m.tkk7.com/dashi99/archive/2012/07/17/383306.htmlhttp://m.tkk7.com/dashi99/comments/383306.htmlhttp://m.tkk7.com/dashi99/archive/2012/07/17/383306.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/383306.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/383306.htmlset define off 鍒欏叧闂鍔熻兘錛?#8220;&”灝嗕綔涓烘櫘閫氬瓧絎︼紝濡備笂渚嬶紝鏈緇堝瓧絎﹀氨涓?#8220;SQL&Plus”
set define off鍏抽棴鏇夸唬鍙橀噺鍔熻兘
set define on 寮鍚浛浠e彉閲忓姛鑳?
set define *  灝嗛粯璁ゆ浛浠e彉閲忔爣蹇楃璇ヤ負(fù)“*”(涔熷彲浠ヨ涓哄叾瀹冨瓧絎?

Example:
SET DEFINE OFF
BEGIN
UPDATE ADMIN.TAG
   SET TYPE_ID = 2,
       SUBCATEGORY_ID = 10,
       UPDATED_BY = 'A&B',
       CREATED_BY = 'A&B',
       CREATED_DATE = SYSDATE,
       UPDATED_DATE = SYSDATE
 WHERE TAG_ID = 2;
END;
/



銈炴矇榛樻槸閲戙倿 2012-07-17 14:22 鍙戣〃璇勮
]]>
Difference between TRUNCATE, DELETE and DROP commandshttp://m.tkk7.com/dashi99/archive/2012/07/12/382884.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Thu, 12 Jul 2012 07:30:00 GMThttp://m.tkk7.com/dashi99/archive/2012/07/12/382884.htmlhttp://m.tkk7.com/dashi99/comments/382884.htmlhttp://m.tkk7.com/dashi99/archive/2012/07/12/382884.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/382884.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/382884.htmlDELETE

 

The DELETE command is used to remove rows from a table. A WHERE clause can be used to only remove some rows. If no WHERE condition is specified, all rows will be removed. After performing a DELETE operation you need to COMMIT or ROLLBACK the transaction to make the change permanent or to undo it. Note that this operation will cause all DELETE triggers on the table to fire.

SQL> SELECT COUNT(*FROM emp;

  
COUNT(*)
----------
        14

SQL
> DELETE FROM emp WHERE job = 'CLERK';

4 rows deleted.

SQL
> COMMIT;

Commit complete.

SQL
> SELECT COUNT(*FROM emp;

  
COUNT(*)
----------
        10

TRUNCATE

 

TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesn't use as much undo space as a DELETE.

SQL> TRUNCATE TABLE emp;

Table truncated.

SQL
> SELECT COUNT(*FROM emp;

  
COUNT(*)
----------
         0

DROP

 

The DROP command removes a table from the database. All the tables' rows, indexes and privileges will also be removed. No DML triggers will be fired. The operation cannot be rolled back.

SQL> DROP TABLE emp;

Table dropped.

SQL
> SELECT * FROM emp;
SELECT * FROM emp
              
*
ERROR at line 
1:
ORA
-00942table or view does not exist
DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command. Therefore DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.

 

From Oracle 10g a table can be "undropped". Example:

 

SQL> FLASHBACK TABLE emp TO BEFORE DROP;

Flashback complete.

 

PS: DROP and TRUNCATE are DDL commands, whereas DELETE is a DML command. As such, DELETE operations can be rolled back (undone), while DROP and TRUNCATE operations cannot be rolled back.


1>TRUNCATE is a DDL command whereas DELETE is a DML command.

2>TRUNCATE is much faster than DELETE.

Reason:When you type DELETE.all the data get copied into the Rollback Tablespace first.then delete operation get performed.Thatswhy when you type ROLLBACK after deleting a table ,you can get back the data(The system get it for you from the Rollback Tablespace).All this process take time.But when you type TRUNCATE,it removes data directly without copying it into the Rollback Tablespace.Thatswhy TRUNCATE is faster.Once you Truncate you cann't get back the data.

3>You cann't rollback in TRUNCATE but in DELETE you can rollback.TRUNCATE removes the record permanently.

4>In case of TRUNCATE ,Trigger doesn't get fired.But in DML commands like DELETE .Trigger get fired.

5>You cann't use conditions(WHERE clause) in TRUNCATE.But in DELETE you can write conditions using WHERE clause
6>TRUNCATE command resets the High Water Mark for the table but DELETE does not. So after TRUNCATE the operations on table are much faster.



銈炴矇榛樻槸閲戙倿 2012-07-12 15:30 鍙戣〃璇勮
]]>
SQL SERVER 2005 濡備綍鍚姩鏈嶅姟?http://m.tkk7.com/dashi99/archive/2009/12/04/304794.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Fri, 04 Dec 2009 09:05:00 GMThttp://m.tkk7.com/dashi99/archive/2009/12/04/304794.htmlhttp://m.tkk7.com/dashi99/comments/304794.htmlhttp://m.tkk7.com/dashi99/archive/2009/12/04/304794.html#Feedback1http://m.tkk7.com/dashi99/comments/commentRss/304794.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/304794.html1.銆屽紑濮嬨嶈彍鍗?>榪愯

--鍚姩sql server 2005 鏈嶅姟
net start mssqlserver

--鍋滄sql server 2005 鏈嶅姟
net stop mssqlserver

2.銆屽紑濮嬨嶈彍鍗?>紼嬪簭->Microsoft SQL Server 2005->閰嶇疆宸ュ叿
SQL Server Configuration Manager->SQL Server(MSSQLSERVER) 鍙沖嚮 鍚姩鏈嶅姟鎴愬姛鍚庯紝鐘舵佹樉紺轟負(fù)“姝e湪榪愯”

3.銆屽紑濮嬨嶈彍鍗?>榪愯->services.msc 鏈嶅姟鎺у埗鍙?br /> SQL Server(MSSQLSERVER) 鍙沖嚮 鍚姩鎴愬姛鍚庯紝鐘舵佹樉紺轟負(fù)“宸插惎鍔?#8221;

娉ㄦ剰錛氬叧浜?433绔彛闂錛?br />       鍦ㄥ畨瑁匰QL SERVER 2005鐨勬椂鍊欓粯璁ゆ病鏈夊惎鍔═CP/IP鍙?433绔彛錛屾垜浠彲浠ュ湪SQL Server Configuration Manager
->SQL Native Client 閰嶇疆->瀹㈡埛绔崗璁?涓嬪皢Tcp/IP鍙?433绔彛寮閫氥?

銈炴矇榛樻槸閲戙倿 2009-12-04 17:05 鍙戣〃璇勮
]]>
can not be represented as java.sql.Timestamphttp://m.tkk7.com/dashi99/archive/2009/06/20/283355.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Sat, 20 Jun 2009 07:20:00 GMThttp://m.tkk7.com/dashi99/archive/2009/06/20/283355.htmlhttp://m.tkk7.com/dashi99/comments/283355.htmlhttp://m.tkk7.com/dashi99/archive/2009/06/20/283355.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/283355.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/283355.html浣跨敤hibernate寮鍙戠▼搴忕殑鏃跺欙紝鏈夌殑鏃墮棿瀛楁娌℃湁蹇呰濉啓錛屼絾鏄紝浠ュ悗hibernate鏌ヨ鐨勬椂鍊欎細(xì)鎶ュ嚭

java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Timestamp

鐨勯敊璇紝 榪欐槸鍥犱負(fù)hibernate璁や負(fù)榪欎釜涓嶆槸涓涓湁鏁堢殑鏃墮棿瀛椾覆銆?

鑰屾湁鏁堢殑鏃ユ湡鏍煎紡涓?#8220; 0001-01-01   00:00:00.0 ”


鏌ョ湅浜?jiǎn)mysql5鐨勫府鍔╂枃妗e浜巇atetime鐨勮В閲婂涓?/p>

Datetimes with all-zero components (0000-00-00 ...) 鈥?These values can not be represented 鍏充簬鎵鏈塂atetime綾誨瀷鐢?緇勬垚鐨勬暟鎹紝榪欎簺鍊間笉鑳藉湪java涓鍙潬鐨勮〃紺?br /> reliably in Java.
Connector/J 3.0.x always converted them to NULL when being read from a ResultSet.
褰撹繖浜涘兼鍦ㄤ粠ResultSet瀹瑰櫒涓鍙栨椂鍊欙紝Connector/J 3.0.x 涓鐩存妸浠栦滑杞崲涓篘ULL鍊箋?/p>

Connector/J 3.1 throws an exception by default when these values are encountered as this is the most correct behavior according to the JDBC and SQL standards.
渚濈収JDBC鍜孲QL鐨勬爣鍑嗚繖浜涘肩鍒扮殑鏈姝g‘鐨勫鐞嗘柟寮忓氨鏄湪緙虹渷鎯呭喌涓嬩駭鐢熷紓甯?br /> This behavior can be modified using the zeroDateTimeBehavior configuration property. The allowable values are:
JDBC鍏佽鐢ㄤ笅鍒楃殑鍊煎zeroDateTimeBehavior 灞炴ф潵璁劇疆榪欎簺澶勭悊鏂瑰紡錛?/p>

exception (the default), which throws an SQLException with an SQLState of S1009.
璁劇疆涓篹xception 寮傚父錛堢己鐪侊級(jí)鐢ㄤ竴涓猄QLState鐨剆1009閿欒鍙鋒潵鎶涘嚭涓涓紓甯?br /> convertToNull, which returns NULL instead of the date.
璁劇疆涓篶onvertToNull錛岀敤NULL鍊兼潵浠f浛榪欎釜鏃ユ湡綾誨瀷
round, which rounds the date to the nearest closest value which is 0001-01-01.
璁劇疆涓簉ound錛屽垯鍥寸粫榪欎釜鏃ユ湡鏈鎺ヨ繎鐨勫鹼紙0001-01-01錛夋潵浠f浛

 

淇敼浣犵殑jdbc榪炴帴

jdbc:mysql://localhost/schoolmis?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull



銈炴矇榛樻槸閲戙倿 2009-06-20 15:20 鍙戣〃璇勮
]]>
鏃犳硶榪滅▼鐧誨叆MySQL Server瑙e喅http://m.tkk7.com/dashi99/archive/2009/02/03/253051.html銈炴矇榛樻槸閲戙倿銈炴矇榛樻槸閲戙倿Tue, 03 Feb 2009 03:26:00 GMThttp://m.tkk7.com/dashi99/archive/2009/02/03/253051.htmlhttp://m.tkk7.com/dashi99/comments/253051.htmlhttp://m.tkk7.com/dashi99/archive/2009/02/03/253051.html#Feedback0http://m.tkk7.com/dashi99/comments/commentRss/253051.htmlhttp://m.tkk7.com/dashi99/services/trackbacks/253051.html銆銆榪欎釜鏄洜涓烘潈闄愮殑闂錛屽鐞嗘柟寮忓涓嬶細(xì) 
銆銆shell>mysql --user=root -p 
銆銆杈撳叆瀵嗙爜 
銆銆mysql>use mysql 
銆銆mysql>GRANT SELECT,INSERT,UPDATE,DELETE ON [db_name].* TO [username]@[ipadd] identified by ’[password]’; 

銆銆[username]:榪滅▼鐧誨叆鐨勪嬌鐢ㄨ呬唬鐮?nbsp;
銆銆錛籨b_name]:琛ㄧず嬈插紑鏀劇粰浣跨敤鑰呯殑鏁版嵁搴撶О 
銆銆[password]:榪滅▼鐧誨叆鐨勪嬌鐢ㄨ呭瘑鐮?nbsp;
銆銆[ipadd]:IP鍦板潃鎴栬匢P鍙嶆煡鍚庣殑DNS Name錛屾渚嬬殑鍐呭闇濉叆’60-248-32-13.HINET-IP.hinet.net’ 錛屽寘鍑戒笂寮曞彿(’) 

銆銆錛堝叾瀹炲氨鏄湪榪滅鏈嶅姟鍣?/a>涓婃墽琛岋紝鍦板潃濉啓鏈湴涓繪満鐨刬p鍦板潃銆傦級(jí) 

銆銆濡傛灉甯屾湜寮鏀炬墍鏈夋潈闄愮殑璇濊鎵ц錛?nbsp;
銆銆mysql>update user set select_priv=’Y’ , Insert_priv=’Y’, Update_priv=’Y’, delete_priv=’Y’, Create_priv=’Y’, Drop_priv=’Y’,Reload_priv=’Y’, shutdown_priv=’Y’, Process_priv=’Y’, File_priv=’Y’, Grant_priv=’Y’, references_priv=’Y’,Index_priv=’Y’, Alter_priv=’Y’, Show_db_priv=’Y’, Super_priv=’Y’,Create_tmp_table_priv=’Y’,Lock_tables_priv=’Y’, Execute_priv=’Y’,Repl_slave_priv=’Y’,Repl_client_priv=’Y’ where user=’[username]’; 

銆銆濡備綍瑙e喅瀹㈡埛绔笌鏈嶅姟鍣ㄧ鐨勮繛鎺?mysql) 錛歺xx.xxx.xxx.xxx is not allowed to connect to this mysql serv  

銆銆榪欎袱澶╂悶MySQL,閬囧埌涓浜涢棶棰橈紝鎬曞繕鎺夛紝鏀句笂鏉ワ紝鐣欑潃澶囩敤 

銆銆榪欎釜鏂規(guī)硶鏄湪google涓婃悳鍑烘潵鐨勶紝涓嶈繃浠栨槸杞嚜CSDN錛宆_^ 

銆銆1銆佽繘鍏ysql錛屽垱寤轟竴涓柊鐢ㄦ埛xuys錛?nbsp;
銆銆 鏍煎紡錛歡rant 鏉冮檺 on 鏁版嵁搴撳悕.琛ㄥ悕 鐢ㄦ埛@鐧誨綍涓繪満 identified by "鐢ㄦ埛瀵嗙爜"; 
銆銆 grant select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234"; 
銆銆   鏌ョ湅緇撴灉錛屾墽琛岋細(xì) 
銆銆   use mysql; 
銆銆   select host,user,password from user; 
銆銆   鍙互鐪嬪埌鍦╱ser琛ㄤ腑宸叉湁鍒氭墠鍒涘緩鐨剎uys鐢ㄦ埛銆俬ost瀛楁琛ㄧず鐧誨綍鐨勪富鏈猴紝鍏跺煎彲浠ョ敤IP錛屼篃鍙敤涓繪満鍚嶏紝 
銆銆   灝唄ost瀛楁鐨勫兼敼涓?灝辮〃紺哄湪浠諱綍瀹㈡埛绔満鍣ㄤ笂鑳戒互xuys鐢ㄦ埛鐧誨綍鍒癿ysql鏈嶅姟鍣紝寤鴻鍦ㄥ紑鍙戞椂璁句負(fù)%銆?nbsp;
銆銆   update user set host = ’%’ where user = ’xuys’; 
銆銆2銆?./mysqladmin -uroot -p21century reload 
銆銆 ./mysqladmin -uroot -p21century shutdown 
銆銆3銆?/mysqld_safe --user-root & 
銆銆璁頒綇錛氬鎺堟潈琛ㄧ殑浠諱綍淇敼閮介渶瑕侀噸鏂皉eload錛屽嵆鎵ц絎?姝ャ?nbsp;

銆銆濡傛灉緇忚繃浠ヤ笂3涓楠よ繕鏄棤娉曚粠瀹㈡埛绔繛鎺ワ紝璇鋒墽琛屼互涓嬫搷浣滐紝鍦╩ysql鏁版嵁搴撶殑db琛ㄤ腑鎻掑叆涓鏉¤褰曪細(xì) 
銆銆use mysql; 
銆銆insert into db values(’192.168.88.234’,’%’,’xuys’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’,’Y’); 
銆銆update db set host = ’%’ where user = ’xuys’; 
銆銆閲嶅鎵ц涓婇潰鐨勭2銆?姝ャ?/p>

銈炴矇榛樻槸閲戙倿 2009-02-03 11:26 鍙戣〃璇勮
]]>
MYSQL 榪炴帴鏁版嵁搴撳懡浠ゆ敹钘?/title><link>http://m.tkk7.com/dashi99/archive/2009/02/03/253038.html</link><dc:creator>銈炴矇榛樻槸閲戙倿</dc:creator><author>銈炴矇榛樻槸閲戙倿</author><pubDate>Tue, 03 Feb 2009 02:47:00 GMT</pubDate><guid>http://m.tkk7.com/dashi99/archive/2009/02/03/253038.html</guid><wfw:comment>http://m.tkk7.com/dashi99/comments/253038.html</wfw:comment><comments>http://m.tkk7.com/dashi99/archive/2009/02/03/253038.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://m.tkk7.com/dashi99/comments/commentRss/253038.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/dashi99/services/trackbacks/253038.html</trackback:ping><description><![CDATA[<div id="krnzzms" class="cnt" id="blog_text"> <p>涓銆丮ySQL 榪炴帴鏈湴鏁版嵁搴擄紝鐢ㄦ埛鍚嶄負(fù)“root”錛屽瘑鐮?#8220;123”錛堟敞鎰忥細(xì)“-p”鍜?#8220;123” 涔嬮棿涓嶈兘鏈夌┖鏍鹼級(jí)</p> <pre class="cmdcode">C:\>mysql -h localhost -u root -p123</pre> <p>浜屻丮ySQL 榪炴帴榪滅▼鏁版嵁搴擄紙192.168.0.201錛夛紝绔彛“3306”錛岀敤鎴峰悕涓?#8220;root”錛屽瘑鐮?#8220;123”</p> <pre class="cmdcode">C:\>mysql -h 172.16.16.45 -P 3306 -u root -p123</pre> <p>涓夈丮ySQL 榪炴帴鏈湴鏁版嵁搴擄紝鐢ㄦ埛鍚嶄負(fù)“root”錛岄殣钘忓瘑鐮?/p> <pre class="cmdcode">C:\>mysql -h localhost -u root -p<br /> Enter password:</pre> <p>鍥涖丮ySQL 榪炴帴鏈湴鏁版嵁搴擄紝鐢ㄦ埛鍚嶄負(fù)“root”錛屾寚瀹氭墍榪炴帴鐨勬暟鎹簱涓?#8220;test”</p> <pre class="cmdcode">C:\>mysql -h localhost -u root -p123 -D test<br /> mysql>select database();<br /> +------------+<br /> | database() |<br /> +------------+<br /> | test |<br /> +------------+</pre> <p>涓嬮潰鏄?MySQL 瀹㈡埛绔懡浠ょ殑璇︾粏鍙傛暟錛?/p> <pre class="cmdcode">mysql Ver 14.12 Distrib 5.0.41, for Win32 (ia32)<br /> Copyright (C) 2002 MySQL AB<br /> This software comes with ABSOLUTELY NO WARRANTY. This is free software,<br /> and you are welcome to modify and redistribute it under the GPL license<br /> <br /> Usage: mysql [OPTIONS] [database]<br /> -?, --help Display this help and exit.<br /> -I, --help Synonym for -?<br /> --auto-rehash Enable automatic rehashing. One doesn't need to use<br /> 'rehash' to get table and field completion, but startup<br /> and reconnecting may take a longer time. Disable with<br /> --disable-auto-rehash.<br /> -A, --no-auto-rehash <br /> No automatic rehashing. One has to use 'rehash' to get<br /> table and field completion. This gives a quicker start of<br /> mysql and disables rehashing on reconnect. WARNING:<br /> options deprecated; use --disable-auto-rehash instead.<br /> -B, --batch Don't use history file. Disable interactive behavior.<br /> (Enables --silent)<br /> --character-sets-dir=name <br /> Directory where character sets are.<br /> --default-character-set=name <br /> Set the default character set.<br /> -C, --compress Use compression in server/client protocol.<br /> -#, --debug[=#] This is a non-debug version. Catch this and exit<br /> -D, --database=name Database to use.<br /> --delimiter=name Delimiter to be used.<br /> -e, --execute=name Execute command and quit. (Disables --force and history<br /> file)<br /> -E, --vertical Print the output of a query (rows) vertically.<br /> -f, --force Continue even if we get an sql error.<br /> -G, --named-commands <br /> Enable named commands. Named commands mean this program's<br /> internal commands; see mysql> help . When enabled, the<br /> named commands can be used from any line of the query,<br /> otherwise only from the first line, before an enter.<br /> Disable with --disable-named-commands. This option is<br /> disabled by default.<br /> -g, --no-named-commands <br /> Named commands are disabled. Use \* form only, or use<br /> named commands only in the beginning of a line ending<br /> with a semicolon (;) Since version 10.9 the client now<br /> starts with this option ENABLED by default! Disable with<br /> '-G'. Long format commands still work from the first<br /> line. WARNING: option deprecated; use<br /> --disable-named-commands instead.<br /> -i, --ignore-spaces Ignore space after function names.<br /> --local-infile Enable/disable LOAD DATA LOCAL INFILE.<br /> -b, --no-beep Turn off beep on error.<br /> -h, --host=name Connect to host.<br /> -H, --html Produce HTML output.<br /> -X, --xml Produce XML output<br /> --line-numbers Write line numbers for errors.<br /> -L, --skip-line-numbers <br /> Don't write line number for errors. WARNING: -L is<br /> deprecated, use long version of this option instead.<br /> -n, --unbuffered Flush buffer after each query.<br /> --column-names Write column names in results.<br /> -N, --skip-column-names <br /> Don't write column names in results. WARNING: -N is<br /> deprecated, use long version of this options instead.<br /> -O, --set-variable=name <br /> Change the value of a variable. Please note that this<br /> option is deprecated; you can set variables directly with<br /> --variable-name=value.<br /> --sigint-ignore Ignore SIGINT (CTRL-C)<br /> -o, --one-database Only update the default database. This is useful for<br /> skipping updates to other database in the update log.<br /> -p, --password[=name] <br /> Password to use when connecting to server. If password is<br /> not given it's asked from the tty.<br /> -W, --pipe Use named pipes to connect to server.<br /> -P, --port=# Port number to use for connection.<br /> --prompt=name Set the mysql prompt to this value.<br /> --protocol=name The protocol of connection (tcp,socket,pipe,memory).<br /> -q, --quick Don't cache result, print it row by row. This may slow<br /> down the server if the output is suspended. Doesn't use<br /> history file.<br /> -r, --raw Write fields without conversion. Used with --batch.<br /> --reconnect Reconnect if the connection is lost. Disable with<br /> --disable-reconnect. This option is enabled by default.<br /> -s, --silent Be more silent. Print results with a tab as separator,<br /> each row on new line.<br /> --shared-memory-base-name=name <br /> Base name of shared memory.<br /> -S, --socket=name Socket file to use for connection.<br /> --ssl Enable SSL for connection (automatically enabled with<br /> other flags). Disable with --skip-ssl.<br /> --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies<br /> --ssl).<br /> --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl).<br /> --ssl-cert=name X509 cert in PEM format (implies --ssl).<br /> --ssl-cipher=name SSL cipher to use (implies --ssl).<br /> --ssl-key=name X509 key in PEM format (implies --ssl).<br /> --ssl-verify-server-cert <br /> Verify server's "Common Name" in its cert against<br /> hostname used when connecting. This option is disabled by<br /> default.<br /> -t, --table Output in table format.<br /> -T, --debug-info Print some debug info at exit.<br /> --tee=name Append everything into outfile. See interactive help (\h)<br /> also. Does not work in batch mode. Disable with<br /> --disable-tee. This option is disabled by default.<br /> --no-tee Disable outfile. See interactive help (\h) also. WARNING:<br /> option deprecated; use --disable-tee instead<br /> -u, --user=name User for login if not current user.<br /> -U, --safe-updates Only allow UPDATE and DELETE that uses keys.<br /> -U, --i-am-a-dummy Synonym for option --safe-updates, -U.<br /> -v, --verbose Write more. (-v -v -v gives the table output format).<br /> -V, --version Output version information and exit.<br /> -w, --wait Wait and retry if connection is down.<br /> --connect_timeout=# Number of seconds before connection timeout.<br /> --max_allowed_packet=# <br /> Max packet length to send to, or receive from server<br /> --net_buffer_length=# <br /> Buffer for TCP/IP and socket communication<br /> --select_limit=# Automatic limit for SELECT when using --safe-updates<br /> --max_join_size=# Automatic limit for rows in a join when using<br /> --safe-updates<br /> --secure-auth Refuse client connecting to server if it uses old<br /> (pre-4.1.1) protocol<br /> --show-warnings Show warnings after every statement.<br /> <br /> Default options are read from the following files in the given order:<br /> C:\my.ini C:\my.cnf C:\WINDOWS\my.ini C:\WINDOWS\my.cnf D:\MySQL\my.ini D:\MySQL\my.cnf <br /> The following groups are read: mysql client<br /> The following options may be given as the first argument:<br /> --print-defaults Print the program argument list and exit<br /> --no-defaults Do not read default options from any options file<br /> --defaults-file=# Only read default options from the given file #<br /> --defaults-extra-file=# Read this file after the global files are read<br /> <br /> Variables (--variable-name=value)<br /> and boolean options {FALSE|TRUE} Value (after reading options)<br /> --------------------------------- -----------------------------<br /> auto-rehash TRUE<br /> character-sets-dir (No default value)<br /> default-character-set utf8<br /> compress FALSE<br /> database (No default value)<br /> delimiter ;<br /> vertical FALSE<br /> force FALSE<br /> named-commands FALSE<br /> local-infile FALSE<br /> no-beep FALSE<br /> host (No default value)<br /> html FALSE<br /> xml FALSE<br /> line-numbers TRUE<br /> unbuffered FALSE<br /> column-names TRUE<br /> sigint-ignore FALSE<br /> port 3306<br /> prompt mysql> <br /> quick FALSE<br /> raw FALSE<br /> reconnect TRUE<br /> shared-memory-base-name (No default value)<br /> socket (No default value)<br /> ssl FALSE<br /> ssl-ca (No default value)<br /> ssl-capath (No default value)<br /> ssl-cert (No default value)<br /> ssl-cipher (No default value)<br /> ssl-key (No default value)<br /> ssl-verify-server-cert FALSE<br /> table FALSE<br /> debug-info FALSE<br /> user (No default value)<br /> safe-updates FALSE<br /> i-am-a-dummy FALSE<br /> connect_timeout 0<br /> max_allowed_packet 16777216<br /> net_buffer_length 16384<br /> select_limit 1000<br /> max_join_size 1000000<br /> secure-auth FALSE<br /> show-warnings FALSE</pre> </div> <img src ="http://m.tkk7.com/dashi99/aggbug/253038.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/dashi99/" target="_blank">銈炴矇榛樻槸閲戙倿</a> 2009-02-03 10:47 <a href="http://m.tkk7.com/dashi99/archive/2009/02/03/253038.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://jdvgo.com" target="_blank">色妞WWW精品免费视频</a>| <a href="http://902578.com" target="_blank">亚洲欧洲日韩在线电影</a>| <a href="http://wusongtv.com" target="_blank">毛片a级三毛片免费播放</a>| <a href="http://55xxb.com" target="_blank">人妻免费一区二区三区最新</a>| <a href="http://959901cc.com" target="_blank">亚洲精品国产高清在线观看</a>| <a href="http://lkzrgy.com" target="_blank">亚洲视频在线免费播放</a>| <a href="http://sewo66.com" target="_blank">亚洲日产韩国一二三四区</a>| <a href="http://1212777.com" target="_blank">国产成人免费片在线观看</a>| <a href="http://baocaoluoli.com" target="_blank">国产福利在线免费</a>| <a href="http://haigoumama.com" target="_blank">污污网站免费观看</a>| <a href="http://see01.com" target="_blank">久久久WWW免费人成精品</a>| <a href="http://ksyanhui.com" target="_blank">国产精品亚洲综合网站</a>| <a href="http://cfxzp.com" target="_blank">亚洲色偷偷偷综合网</a>| <a href="http://720880.com" target="_blank">亚洲国产综合在线</a>| <a href="http://zc-zk.com" target="_blank">亚洲最大成人网色</a>| <a href="http://kan63.com" target="_blank">亚洲va无码va在线va天堂</a>| <a href="http://33a55.com" target="_blank">亚洲一级特黄大片在线观看</a>| <a href="http://www676617.com" target="_blank">四虎影视在线永久免费看黄</a>| <a href="http://930mk.com" target="_blank">成年美女黄网站18禁免费</a>| <a href="http://7t53.com" target="_blank">波多野结衣中文字幕免费视频 </a>| <a href="http://bwgdbjb.com" target="_blank">日韩免费在线观看</a>| <a href="http://wwwk47.com" target="_blank">久久笫一福利免费导航</a>| <a href="http://iguasheng.com" target="_blank">13一14周岁毛片免费</a>| <a href="http://jcthbank.com" target="_blank">久久免费动漫品精老司机</a>| <a href="http://www-533999.com" target="_blank">在线观看人成视频免费无遮挡 </a>| <a href="http://701807.com" target="_blank">性色av无码免费一区二区三区</a>| <a href="http://gdbobo.com" target="_blank">999久久久免费精品播放</a>| <a href="http://moushengguigz.com" target="_blank">叮咚影视在线观看免费完整版</a>| <a href="http://bisilover.com" target="_blank">一级毛片试看60分钟免费播放</a>| <a href="http://180xiu.com" target="_blank">色费女人18女人毛片免费视频</a>| <a href="http://12345ww.com" target="_blank">春暖花开亚洲性无区一区二区</a>| <a href="http://jkc178.com" target="_blank">亚洲七久久之综合七久久</a>| <a href="http://sdsupuchem.com" target="_blank">91精品国产免费久久国语蜜臀</a>| <a href="http://www398ph.com" target="_blank">日本卡1卡2卡三卡免费</a>| <a href="http://xianfeng-motor.com" target="_blank">a级精品九九九大片免费看</a>| <a href="http://cytanhuang.com" target="_blank">久久久久久久久久久免费精品</a>| <a href="http://vvihh.com" target="_blank">日韩亚洲AV无码一区二区不卡</a>| <a href="http://kdltuliao.com" target="_blank">免费在线看污视频</a>| <a href="http://fkg675.com" target="_blank">精品亚洲一区二区三区在线观看</a>| <a href="http://tv886.com" target="_blank">成人黄网站片免费视频</a>| <a href="http://shaolingtongluo.com" target="_blank">亚洲中文字幕久久精品无码2021</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>