cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Connection closes between 'stmt.execute( ... ) and stmt.executeQuery( ... )

dataAllMyLife
New Contributor

I'm running a Java application that registers a CSV table with HIVE and then checks the number of rows imported. Its done in several steps.:

Statement stmt = con.createStatement();

....

stmt.execute( "CREATE TABLE ( <definition> < > );

.....

ResultSet rs = stmt.executeQuery( "SELECT count(*) as rowCnt from ...... );

while (rs.next()) {

rows = rs.getLong(1);

}

As soon as the 2nd statement gets executed I receive an exception

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.

Apr 27, 2022 12:59:37 PM com.simba.spark.jdbc42.internal.apache.http.impl.execchain.RetryExec execute

INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://<id>.cloud.databricks.com:443: Connection or outbound has closed

Apr 27, 2022 12:59:37 PM com.simba.spark.jdbc42.internal.apache.http.impl.execchain.RetryExec execute

INFO: Retrying request to {s}->https://<id>.cloud.databricks.com:443

Any ideas or inputs are appreciated .....

1 REPLY 1

Noopur_Nigam
Valued Contributor II
Valued Contributor II

@Reto Matter​  Are you running a jar job or using dbconnect to run java code? Please provide how are you trying to make a connection and full exception stack trace.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.