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

  • Home
  • SEARCH
  • 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 6614049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:17:30+00:00 2026-05-25T20:17:30+00:00

I am writing a Java code to read Blob objects from an Oracle database

  • 0

I am writing a Java code to read Blob objects from an Oracle database table.

I need to retrieve the blob objects and store them into a String for further processing.
I convert the blob objects contents to String by this :

java.sql.Blob blob = rs.getBlob(i);
columnValue = new String(blob.getBytes(1l, (int) blob.length()));

However when I try to parse the resultant string, I get errors which say “Not a valid escape sequence” because apparently the Blob data consists of some data like \x, \i or something !

Is there a way to make Java ignore these escape sequences and make it to just consider the string with its contents as it is (i.e Strings containing \x, \i etc.) ?

  • 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-05-25T20:17:31+00:00Added an answer on May 25, 2026 at 8:17 pm

    I assume that by “parse” you mean something related to regex, because otherwise storing these values in a string will work fine – the escape sequences are useful only for string literals and regexes.

    Anyway, StringEscapeUtils.escapeJava(..) should do what you want (it’s from commons-lang)

    Apart from that – you should use java.sql.Clob for textual data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a full database extract program in java. Database is Oracle, and
So I am writing a Java code to represent a heap sort and to
I am writing some Java code that authenticates to Active Directory using SASL GSSAPI.
Sometimes while writing Java in Eclipse, I write code that generates warnings. A common
I am writing code in Java where I branch off based on whether a
I am writing a piece of code in Java that needs to take a
I'm writing HTML code for a Java servlet. I first write the code in
How would I go about writing some code to allow access to a Java
I'm in Eclipse writing Java. I come from Visual Studio with Resharper writing C#.
I am having difficulties w/ writing and reading an array of objects from a

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.