欢迎投稿

今日深度:

cassandra中bigint,cassandrabigint

cassandra中bigint,cassandrabigint


获取结果集的时候 数据库中有个字段是bigint

int callNum=  row.getInt("callnum");
System.out.println((Integer) (row.getObject("callnum")));

使用第一中方式获取时:

com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [bigint <-> java.lang.Integer]

使用第二种方法获取时:

threw exception [Request processing failed; nested exception is java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer] with root cause

试过double 和 float 都不行。所以我不知道这个bigint到底用什么接收。
我只能改数据库字段类型为int才行。希望有知道这个问题的大神指教一下。

附转换表:
参考

www.htsjk.Com true http://www.htsjk.com/cassandra/29488.html NewsArticle cassandra中bigint,cassandrabigint 获取结果集的时候 数据库中有个字段是bigint int callNum= row .getInt ( "callnum" ) ; System .out .println ((Integer) (row .getObject ( "callnum" ))) ; 使用第一中方式获取时: com...
相关文章
    暂无相关文章
评论暂时关闭