@@ -177,18 +177,6 @@ private DBConnectionImpl(boolean asynTask, boolean sslEnable, boolean compress,
177
177
this .lock_ = new ReentrantLock ();
178
178
}
179
179
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
-
192
180
private boolean connect (String hostName , int port , String userId , String password , int connTimeout ) throws IOException {
193
181
this .hostName_ = hostName ;
194
182
this .port_ = port ;
@@ -245,6 +233,8 @@ private boolean connect()throws IOException{
245
233
return false ;
246
234
}
247
235
236
+ String msg = in_ .readLine ();
237
+
248
238
isConnected_ = true ;
249
239
250
240
if (line .charAt (endPos + 1 ) == '0' ) {
@@ -447,17 +437,15 @@ private Entity run(String script, String scriptType, ProgressListener listener,
447
437
if (asynTask_ )
448
438
return null ;
449
439
450
- ExtendedDataInput in = remoteLittleEndian_ ? new LittleEndianDataInputStream (new BufferedInputStream (socket_ .getInputStream ())) :
451
- new BigEndianDataInputStream (new BufferedInputStream (socket_ .getInputStream ()));
452
440
String header = null ;
453
441
try {
454
- header = in .readLine ();
442
+ header = in_ .readLine ();
455
443
while (header .equals ("MSG" )) {
456
444
//read intermediate message to indicate the progress
457
- String msg = in .readString ();
445
+ String msg = in_ .readString ();
458
446
if (listener != null )
459
447
listener .progress (msg );
460
- header = in .readLine ();
448
+ header = in_ .readLine ();
461
449
}
462
450
}catch (IOException ex ){
463
451
isConnected_ = false ;
@@ -476,7 +464,7 @@ private Entity run(String script, String scriptType, ProgressListener listener,
476
464
int numObject = Integer .parseInt (headers [1 ]);
477
465
478
466
try {
479
- header = in .readLine ();
467
+ header = in_ .readLine ();
480
468
}catch (IOException ex ){
481
469
isConnected_ = false ;
482
470
socket_ = null ;
@@ -496,7 +484,7 @@ private Entity run(String script, String scriptType, ProgressListener listener,
496
484
497
485
short flag ;
498
486
try {
499
- flag = in .readShort ();
487
+ flag = in_ .readShort ();
500
488
int form = flag >> 8 ;
501
489
int type = flag & 0xff ;
502
490
boolean extended = type >= 128 ;
@@ -513,10 +501,10 @@ private Entity run(String script, String scriptType, ProgressListener listener,
513
501
514
502
515
503
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_ );
517
505
}
518
506
EntityFactory factory = BasicEntityFactory .instance ();
519
- return factory .createEntity (df , dt , in , extended );
507
+ return factory .createEntity (df , dt , in_ , extended );
520
508
}catch (IOException ex ){
521
509
isConnected_ = false ;
522
510
socket_ = null ;
@@ -609,23 +597,23 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress)
609
597
}
610
598
611
599
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 );
613
601
this .mutex_ = new ReentrantLock ();
614
602
}
615
603
616
604
617
605
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 );
619
607
this .mutex_ = new ReentrantLock ();
620
608
}
621
609
622
610
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 );
624
612
this .mutex_ = new ReentrantLock ();
625
613
}
626
614
627
615
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 );
629
617
this .mutex_ = new ReentrantLock ();
630
618
}
631
619
0 commit comments