cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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
Databricks Employee
Databricks Employee

@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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group