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 6824795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:56:40+00:00 2026-05-26T21:56:40+00:00

I have to read the below SQL statement from one properties. update scoreconfig set

  • 0

I have to read the below SQL statement from one properties.

update  scoreconfig  set scorestatus=0 where scoreversion=props.getProperty("scoreversion");

And value for score version I’ve to take it from other properties file.

But, when I prepare a statement in java function as below:

final String query = strLine;
PreparedStatement ps=con.prepareStatement(query);

where query has

update  scoreconfig  set scorestatus=0 where scoreversion=props.getProperty("scoreversion");

But I get

Error: ORA-00911: invalid character

…when I do ps.execute();

  • 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-26T21:56:41+00:00Added an answer on May 26, 2026 at 9:56 pm

    I assume props is a Properties instance or similar. If so, the props.getProperty("scoreversion") part is meant to happen at the Java layer, not in the database. Instead:

    String sql = "update scoreconfig set scorestatus=0 where scoreversion=?";
    PreparedStatement ps = con.prepareStatement(sql);
    // If scoreversion is a String:
    ps.setString(1, props.getProperty("scoreversion"));
    ResultSet rs = ps.executeQuery();
    

    …or if scoreversion is an int, use this instead of the setString line:

    // It scoreversion is an int:
    ps.setInt(1, Integer.parseInt(props.getProperty("scoreversion")));
    

    …etc., convert as appropriate.

    Basically, when you use prepareStatement, you use ? where parameters should go, and then you use setXyz on the PreparedStatement instance to set those parameters. (Oddly, they start with 1, not 0.) Note that even when the parameter is a String, you don’t put quotes around it in the SQL you pass into prepareStatement; that’s handled for you (along with properly escaping that string to prevent SQL injection, so PreparedStatement and setXyz are your friends, you’ll get to know them well).

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

Sidebar

Related Questions

I have a basic sql statement that looks up a user and returns one
I have the syntax below. I have set up sql constraints (i.e. foreign key
**Update: Title should have read: Sql Query - Unique item with latest entry Hi
I have a bash script as below, and I want it to read two
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can
I have written an SQL script having the below query. The query works fine.
I have two MS SQL 2005 servers, one for production and one for test
I have 2 views in SQL set up: PurchaseOrder PurchaseOrderLineItems These have many columns
I have a UDA in SQL 2005 that keeps generating the below error. I'm
I have no problems to pass numbers and strings back and forth from PL/SQL

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.