kylin-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 薛超 <future3...@gmail.com>
Subject when I use odbc to connect kylin , there is a problem
Date Thu, 05 Mar 2015 09:03:50 GMT
*USE ODBC*
public static void test() throws Exception {
Class.forName("com.kylinolap.kylin.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:odbc:TEST",
"ADMIN", "KYLIN");
PreparedStatement state = conn
.prepareStatement("select * from p09_or22g");
ResultSet resultSet = state.executeQuery();
while (resultSet.next()) {
System.out.println(resultSet.getString(1) + "=="
+ resultSet.getString(2) + "==" + resultSet.getString(3));
}
}


Exception in thread "main" java.lang.ClassNotFoundException:
com.kylinolap.kylin.jdbc.Driver


could tell me the correct driver name for kylin ?


*when I use jdbc to connection *


public static void testWithCubeData() throws Exception {
        Driver driver = (Driver)
Class.forName("com.kylinolap.jdbc.Driver").newInstance();
        Properties info = new Properties();
        info.put("user", "ADMIN");
        info.put("password", "KYLIN");
        Connection conn = driver.connect("jdbc:kylin://
153.65.129.144/default", info);

        PreparedStatement state = conn.prepareStatement("select * from
p09_or22g");
        ResultSet resultSet = state.executeQuery();
        while (resultSet.next()) {
            System.out.println(resultSet.getString(1) + "==" +
resultSet.getString(2) + "==" + resultSet.getString(3));
        }
    }

Exception in thread "main" java.sql.SQLException: Authentication Failed.
at com.kylinolap.jdbc.Driver$1.onConnectionInit(Driver.java:114)
at
net.hydromatic.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:137)
at com.kylinolap.jdbc.Test.testWithCubeData(Test.java:16)
at com.kylinolap.jdbc.Test.main(Test.java:28)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message