Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8180305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:11:07+00:00 2026-06-07T00:11:07+00:00

i am using cassandra-jdbc to perform the operation on data in cassandra but when

  • 0

i am using cassandra-jdbc to perform the operation on data in cassandra but when i run this simple program i get exception.

this is my code:

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 qry = "select name FROM cql";

            Statement smt = con.createStatement();
            ResultSet resultSet = smt.executeQuery(qry);
            System.out.println(resultSet);
            while(resultSet.next())
            {
                System.out.println(resultSet);
            }


        }
        catch(Exception e)
        {
            System.out.println(" : "+e.getMessage());
        }
            }
}

i got :cannot parse ‘name’ as hex bytes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:11:08+00:00Added an answer on June 7, 2026 at 12:11 am

    Try:

    import static org.apache.cassandra.utils.Hex.bytesToHex;
    ...
    
    String name = bytesToHex("name".getBytes());
    String qry = "select '" + name + "' FROM cql";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the CQL syntax with cassandra-jdbc driver.... this doesnt work, just get empty strings:
I'm getting NullPointerException :s when using sstable2json in Cassandra 0.6.0-beta3: $ bin/sstable2json .../cassandra/data/system/LocationInfo-1-Data.db Exception
Is there any way to get data from cassandra through phpcassa using a clauses?
I am using the hector HOM library to access my cassandra datastore. This library
I've been using Cassandra instance without reboot for a few days for a simple
I am using Erlang to interface with Cassandra and I cannot get the get_slice
I tried connecting to my cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client This
I would like to start using Cassandra with a node.js deployment, but I can't
[Hi, I asked this question in the morning but could not get any response
I have a problem in getting some data out from Cassandra using c# and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.