当我运行这个程序时,我在输出屏幕中得到了这个。我不知道是什么问题,有什么我遗漏的。
import org.apache.cassandra.cql.jdbc.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.*;
import javax.sql.*;
public class Operations
{
public static void main(String[] args){
try
{
Class.forName("org.apache.cassandra.cql.jdbc.CassandraDriver");
Connection con = DriverManager.getConnection("jdbc:cassandra://localhost:9160/temp");
//String name = "name";
String qry = "select name FROM tempcql where key = detail";
Statement smt = con.createStatement();
ResultSet resultSet = smt.executeQuery(qry);
while(resultSet.next())
{
System.out.println(resultSet.getString("name"));
}
}
catch(Exception e)
{
System.out.println(" : "+e.getMessage());
}
}
}
这是它的输出:java.nio.HeapByteBuffer[pos=86 lim=91 cap=159]