1+ package drill ;
2+
13import java .sql .*;
24import java .lang .ClassNotFoundException ;
35
@@ -7,14 +9,14 @@ public class DrillCollaboration {
79 // private static final String JDBC_DRIVER = "oadd.org.apache.calcite.avatica.remote.Driver";
810 private static final String JDBC_DRIVER = "org.apache.drill.jdbc.Driver" ;
911
10- private static final String CONNECTION_URL = "jdbc:drill:drillbit=ubsdpdesp000103.vantagedp.org:31010 ;auth=MAPRSASL" ;
11- // private static final String QUERY = "select sessionId, isReprocessable from dfs.`/mapr/dp.prod.zurich/vantage/data/store/v6/BM67/2020/*/*/part*.parquet` ";
12+ // private static final String CONNECTION_URL = "jdbc:drill:drillbit=127.0.0.1:41010 ;auth=MAPRSASL";
13+ private static final String CONNECTION_URL = "jdbc:drill:drillbit=127.0.0.1:41010;auth=MAPRSASL " ;
1214 private static final String QUERY = "select * from sys.version" ;
1315
1416 private static Connection getConnection () throws ClassNotFoundException , SQLException {
15- System .out .println ("get class by name: " +JDBC_DRIVER );
17+ System .out .println (">>> get class by name: " +JDBC_DRIVER );
1618 Class .forName (JDBC_DRIVER );
17- System .out .println ("obtaining connection" );
19+ System .out .println (">>> obtaining connection" );
1820 return DriverManager .getConnection (CONNECTION_URL );
1921 }
2022
@@ -23,17 +25,17 @@ public static void main(String[] args) throws SQLException {
2325 try {
2426 connection = getConnection ();
2527 } catch (ClassNotFoundException e ) {
26- System .err .println ("class not found: " +e .getMessage ());
28+ System .err .println ("!!! class not found: " +e .getMessage ());
2729 System .exit (1 );
2830 } catch (SQLException e ) {
29- System .err .println ("class not found: " +e .getMessage ());
31+ System .err .println ("!!! class not found: " +e .getMessage ());
3032 System .exit (2 );
3133 }
32- System .out .println ("connection established" );
34+ System .out .println (">>> connection established" );
3335 Statement statement = connection .createStatement ();
34- System .out .println ("statement created" );
36+ System .out .println (">>> statement created" );
3537 ResultSet resultSet = statement .executeQuery (QUERY );
36- System .out .println ("attempt to retrieve results" );
38+ System .out .println (">>> attempt to retrieve results" );
3739 while (resultSet .next ()) {
3840 System .out .println (resultSet .getString (1 ));
3941 }
0 commit comments