连接 cassandra 数据库是否需要任何驱动程序 jar
我正在尝试构建一个 poc,其中后端是 cassandra,前端是 j2ee。我已将 cassandra lib 文件夹中可用的 jar 文件添加到我的 java id(eclipse) 中。但在这种情况下,有几个 api 方法不被识别!
是否有像 oracle 或 sybase 一样需要添加的 cassandra 驱动程序 jar?
I am trying to build a poc where back-end is cassandra and front end is j2ee. I have added the jar files available in cassandra lib folder into my java id(eclipse). But several api method is not being recognized in this context!
Is there any driver jar for cassandra that needs to be added as in case of oracle or sybase?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 j2ee 中不需要 cassandra jar。官方客户端 API 是 Thrift,这里有一个关于如何使用 thrift 连接的 java 示例 -
http://wiki.apache.org/cassandra/ThriftExamples
有一些 java 包装器可用于Thrift 与 Cassandra 连接(因为 Thrift API 对用户不太友好)。
其中我强烈推荐赫克托——
http://prettyprint.me/2010/02/23/ hector-a-java-cassandra-client/
You don't need cassandra jars in your j2ee. The official client side API is Thrift, here's a java example on how to connect using thrift -
http://wiki.apache.org/cassandra/ThriftExamples
there are a few java wrappers available for Thrift to connect with Cassandra (as Thrift API is not very user friendly).
Among them I can highly recommend Hector -
http://prettyprint.me/2010/02/23/hector-a-java-cassandra-client/
你为什么不试试赫克托:
https://github.com/rantav/hector
Why don't you try Hector:
https://github.com/rantav/hector