@@ -177,18 +177,6 @@ private DBConnectionImpl(boolean asynTask, boolean sslEnable, boolean compress,
177177 this .lock_ = new ReentrantLock ();
178178 }
179179
180- private DBConnectionImpl (boolean asynTask , boolean sslEnable , boolean compress , boolean python , boolean ifUrgent , SqlStdEnum sqlStd ){
181- sessionID_ = "" ;
182- this .sslEnable_ = sslEnable ;
183- this .asynTask_ = asynTask ;
184- this .compress_ = compress ;
185- this .ifUrgent_ = ifUrgent ;
186- this .python_ = python ;
187- this .isReverseStreaming_ = false ;
188- this .sqlStd_ = sqlStd ;
189- this .lock_ = new ReentrantLock ();
190- }
191-
192180 private boolean connect (String hostName , int port , String userId , String password , int connTimeout ) throws IOException {
193181 this .hostName_ = hostName ;
194182 this .port_ = port ;
@@ -245,6 +233,8 @@ private boolean connect()throws IOException{
245233 return false ;
246234 }
247235
236+ String msg = in_ .readLine ();
237+
248238 isConnected_ = true ;
249239
250240 if (line .charAt (endPos + 1 ) == '0' ) {
@@ -447,17 +437,15 @@ private Entity run(String script, String scriptType, ProgressListener listener,
447437 if (asynTask_ )
448438 return null ;
449439
450- ExtendedDataInput in = remoteLittleEndian_ ? new LittleEndianDataInputStream (new BufferedInputStream (socket_ .getInputStream ())) :
451- new BigEndianDataInputStream (new BufferedInputStream (socket_ .getInputStream ()));
452440 String header = null ;
453441 try {
454- header = in .readLine ();
442+ header = in_ .readLine ();
455443 while (header .equals ("MSG" )) {
456444 //read intermediate message to indicate the progress
457- String msg = in .readString ();
445+ String msg = in_ .readString ();
458446 if (listener != null )
459447 listener .progress (msg );
460- header = in .readLine ();
448+ header = in_ .readLine ();
461449 }
462450 }catch (IOException ex ){
463451 isConnected_ = false ;
@@ -476,7 +464,7 @@ private Entity run(String script, String scriptType, ProgressListener listener,
476464 int numObject = Integer .parseInt (headers [1 ]);
477465
478466 try {
479- header = in .readLine ();
467+ header = in_ .readLine ();
480468 }catch (IOException ex ){
481469 isConnected_ = false ;
482470 socket_ = null ;
@@ -496,7 +484,7 @@ private Entity run(String script, String scriptType, ProgressListener listener,
496484
497485 short flag ;
498486 try {
499- flag = in .readShort ();
487+ flag = in_ .readShort ();
500488 int form = flag >> 8 ;
501489 int type = flag & 0xff ;
502490 boolean extended = type >= 128 ;
@@ -513,10 +501,10 @@ private Entity run(String script, String scriptType, ProgressListener listener,
513501
514502
515503 if (fetchSize >0 && df == Entity .DATA_FORM .DF_VECTOR && dt == Entity .DATA_TYPE .DT_ANY ){
516- return new EntityBlockReader (in );
504+ return new EntityBlockReader (in_ );
517505 }
518506 EntityFactory factory = BasicEntityFactory .instance ();
519- return factory .createEntity (df , dt , in , extended );
507+ return factory .createEntity (df , dt , in_ , extended );
520508 }catch (IOException ex ){
521509 isConnected_ = false ;
522510 socket_ = null ;
@@ -609,23 +597,23 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress)
609597 }
610598
611599 public DBConnection (boolean asynchronousTask , boolean useSSL , boolean compress , boolean usePython ){
612- this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , false , SqlStdEnum .DolphinDB );
600+ this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , false , false , SqlStdEnum .DolphinDB );
613601 this .mutex_ = new ReentrantLock ();
614602 }
615603
616604
617605 public DBConnection (boolean asynchronousTask , boolean useSSL , boolean compress , boolean usePython , SqlStdEnum sqlStd ){
618- this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , false , sqlStd );
606+ this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , false , false , sqlStd );
619607 this .mutex_ = new ReentrantLock ();
620608 }
621609
622610 public DBConnection (boolean asynchronousTask , boolean useSSL , boolean compress , boolean usePython , boolean isUrgent ){
623- this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , isUrgent , SqlStdEnum .DolphinDB );
611+ this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , isUrgent , false , SqlStdEnum .DolphinDB );
624612 this .mutex_ = new ReentrantLock ();
625613 }
626614
627615 public DBConnection (boolean asynchronousTask , boolean useSSL , boolean compress , boolean usePython , boolean isUrgent , SqlStdEnum sqlStd ){
628- this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , isUrgent , sqlStd );
616+ this .conn_ = new DBConnectionImpl (asynchronousTask , useSSL , compress , usePython , isUrgent , false , sqlStd );
629617 this .mutex_ = new ReentrantLock ();
630618 }
631619
0 commit comments