kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luke Han (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (KYLIN-945) Kylin JDBC - Get Connection from DataSource results in NullPointerException
Date Tue, 25 Aug 2015 12:44:47 GMT

     [ https://issues.apache.org/jira/browse/KYLIN-945?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Luke Han updated KYLIN-945:
---------------------------
    Fix Version/s:     (was: v1.0)
                   v1.1

> Kylin JDBC - Get Connection from DataSource results in NullPointerException
> ---------------------------------------------------------------------------
>
>                 Key: KYLIN-945
>                 URL: https://issues.apache.org/jira/browse/KYLIN-945
>             Project: Kylin
>          Issue Type: Bug
>          Components: Driver - JDBC
>    Affects Versions: v1.0
>            Reporter: S├ębastien Jelsch
>            Assignee: Shaofeng SHI
>             Fix For: v1.1
>
>         Attachments: kylin-945.patch
>
>
> Trying to get JDBC Connection from DataSource results in NullPointerException after upgrading
to Apache Calcite 1.3.0.
> It's necessary for Mondrian integration.
> *+Example:+*
> {code:title=KylinDataSourceConnection.java|borderStyle=solid}
> import java.sql.Connection;
> import java.sql.SQLException;
> import java.sql.Statement;
> import org.apache.commons.dbcp.BasicDataSource;
> public class KylinDataSourceConnection {
>   public static void main(String[] args) {
>     BasicDataSource basicDataSource = new BasicDataSource();
>     basicDataSource.setDriverClassName("org.apache.kylin.jdbc.Driver");
>     basicDataSource.setUrl("jdbc:kylin://localhost:7070/projectName");
>     basicDataSource.setUsername("admin");
>     basicDataSource.setPassword("KYLIN");
>     try {
>       Connection conn = basicDataSource.getConnection();
>       Statement stmt = conn.createStatement();
>       stmt.executeQuery("SELECT count(*) FROM FACTS"); 
>     } catch (SQLException e) {
>       e.printStackTrace();
>     }   
>   }
> }
> {code}
> *+Exception:+*
> {quote}
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.calcite.avatica.AvaticaConnection.getAutoCommit(AvaticaConnection.java:137)
>   at org.apache.commons.dbcp.DelegatingConnection.getAutoCommit(DelegatingConnection.java:337)
>   at org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableConnectionFactory.java:703)
>   at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1557)
>   at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
>   at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
>   at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>   at org.testsource.mondrianlagunitas.KylinDataSourceConnection.main(KylinDataSourceConnection.java:19)
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message