I have tried to read data from Databricks using the following java code.
String TOKEN = "token...";
String url = "url...";
Properties properties = new Properties();
properties.setProperty("user", "token");
properties.setProperty("PWD", TOKEN);
Connection connection = DriverManager.getConnection(url, properties);
String query = "select * from schema.table";
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery(query);
while(rs.next()) {
int colCount = rs.getMetaData().getColumnCount();
for(int col=1; col<=colCount; col++){
System.out.print(rs.getString(col) + " ");
}
System.out.println();
}
But every time when I run this java program, some errors are being logged by StatusLogger and I don't know how to resolve those errors.
Note:
- Apart from databricks-jdbc dependency, I also have log4j as a dependency.
Things I have noticed:
- If I remove log4j from my dependency, no errors are being logged in the console.
Can someone please help me resolving this issue?
Can someone also please explain me why databricks-jdbc has an internal log4j instead of using log4j as its dependency?