How to Connect to Drill via JDBC fails with IllegalStateException (java.lang.IllegalStateException: No DrillbitEndpoint can be found)

Share on Google+Share on FacebookShare on LinkedInPin on PinterestTweet about this on TwitterEmail this to someone

This  is my own  Generated code which I am using to connect to Drill via JDBC and query  *.csv file on my cloudera sandbox.

Code:

try{
Class.forName(“org.apache.drill.jdbc.Driver”);
Connection connection =DriverManager.getConnection(“jdbc:drill:zk=localhost:2181″,”root”,”cloudera”);
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery(“SELECT * from dfs.`/home/cloudera/Desktop/test.csv`”);
while(rs.next()){
System.out.println(rs.getString(1));
…..
}
}catch(Exception e){
//Handle errors
e.printStackTrace();
}
(more…)

Read More