ksql-jdbc-driver
ksql-jdbc-driver copied to clipboard
ClassNotFoundException
I am trying to connect to ksqldb public class MainClass {
public static void main(String[] args) {
try {
Class.forName("com.github.mmolimar.ksql.jdbc.KsqlDriver");
KsqlDriver driver=new KsqlDriver();
String url="jdbc:ksql://localhost:8089";
KsqlConnection con=driver.buildConnection(KsqlDriver.parseUrl(url), null);
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from KSQLTEST");
while(rs.next()) {
System.out.println(rs.getString(0));
}
} catch (ClassNotFoundException | SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
but I m facing this issue
Exception in thread "main" java.lang.NoClassDefFoundError: io/confluent/ksql/rest/client/KsqlRestClient
at com.github.mmolimar.ksql.jdbc.KsqlConnection.init(KsqlConnection.scala:177)
at com.github.mmolimar.ksql.jdbc.KsqlConnection.
Hi. Is the classpath properly set? I mean, all dependencies the driver has are included?
yes can you tell me list of dependency that are need to connect
When you build the project with sbt clean assembly
all deps are in the fat jar.