phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco <marco....@gmail.com>
Subject JDBC: Result set is null (Select)
Date Mon, 12 Jan 2015 09:58:11 GMT
I have a table 'truck_events' in Hbase, which I've created via Phoenix :

stmt.executeUpdate("create table \"truck_events\"  ( pk varchar
primary key, \"events\".e VARCHAR)");

Now, I fill with a java application data into this table. This works
well. The rows in Hbase Shell
looks like:

ROW                   COLUMN+CELL
 11|1|922337061612340 column=events:d, timestamp=1421050588783, value=11
 8527
 11|1|922337061612340 column=events:e, timestamp=1421050588783, value=Normal
 8527
 11|1|922337061612340 column=events:la, timestamp=1421050588783, value=42.143401
 8527                 00000004
 11|1|922337061612340 column=events:lo, timestamp=1421050588783, value=-79.67304
 8527                 1999999896
 11|1|922337061612340 column=events:t, timestamp=1421050588783, value=1
 8527
 11|1|922337061612340 column=events:tim, timestamp=1421050588783, value=\x00\x00
 8527                 \x01J\xCA0?p
 11|1|922337061612341 column=events:d, timestamp=1421050588770, value=11
 2542


Now I want to select the data via Apache Phoenix via JDBC:

PreparedStatement statement = con.prepareStatement("select * from
\"truck_events\"");
rset = statement.executeQuery();

ResultSetMetaData rsmd = rset.getMetaData();
System.out.println("No. of columns : " + rsmd.getColumnCount());

while (rset.next()) {
    System.out.println(rset.getString(2));
}

The select statement works, but the result set (rset.getString())
returns for each row 'null'. Also if I provide the column name. What
do I do wrong here?

I've tried it with a simple other table and there all works fine.

Thanks,
Marco

Mime
View raw message