10 Replies Latest reply: Jun 18, 2012 1:24 PM by Onno Bagijn RSS

Connect From Java

Erhan Keseli
Currently Being Moderated

Hi all,

 

I am trying to connect HANA from Java. Here is my code:

 

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

java.sql.Connection conn = java.sql.DriverManager.getConnection("jdbc:odbc:HANA:PORT", "username", "password");

Statement stmt = conn.createStatement();

ResultSet rs = stmt.executeQuery("SELECT Statement);

while (rs.next()) {

     //

}

rs.close();

stmt.close();

conn.close();

 

And I get error: "[unixODBC][Driver Manager]DRIVER keyword syntax error"

 

Anyone to help me about this?

Actions

Incoming Links