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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:45:13+00:00 2026-06-15T00:45:13+00:00

I have to develop a small program that inserts some data into an Oracle

  • 0

I have to develop a small program that inserts some data into an Oracle database. Unfortunately I have some trouble with a SQL Statement and the execution of it. This is the code I am using:

db.execute(
    String.format("INSERT INTO tops VALUES (%d, '%s', %d, %f.00, '%s', TO_TIMESTAMP('%s', 'YYYY-MM-DD HH24:MI:SS.FF'))", 
        item.getID(),
        item.getTitle(),
        this.elements,
        item.getSize(),
        item.getEntity(),
        timestamp.toString()));

This is the part where the execution should work but I get the following error:

java.sql.SQLException: ORA-00913: Zu viele Werte

Google Translate for exception is:

java.sql.SQLException: ORA-00913: Too many values
  • 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-15T00:45:14+00:00Added an answer on June 15, 2026 at 12:45 am

    You can use prepared statements like this as suggested by Guallaume on the comment;

    PreparedStatement pstmt = null;
    Connection conn = null;
    
    try{
         //if you have a method that creates a connection for you.
         conn = getConnection();
         pstmt = conn.prepareStatement("INSERT INTO tops(id, title, elements, size, entity, timeStamp) VALUES(?,?,?,?,?,?)");
         pstmt.setInt(1,item.getID());
    
         //Assuming that title is a String data type
         pstmt.setString(2,item.getTitle());
         pstmt.setString(3,this.elements);
         pstmt.setDouble(4,item.getSize()); // <--- JDBC will make sure this works
    
         //assuming Entity data type is String
         pstmt.setString(5,item.getEntity());
    
         //if your timestamp's string format is 
         //well formed, you may insert as a string.
         pstmt.setString(6,timestamp.toString());
         pstmt.executeUpdate();
    }catch(Exception e){
         e.printStackTrace();
    }finally{  
         try{
             pstmt.close();
         }catch(Exception e){}
    
         try{
             conn.close();
         }catch(Exception e){}
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to develop a tool in C# that retrieves some data from an
I have develop a small web application in asp.net (c#) for uploading files into
I am currently trying to develop a small simulation program in xna that takes
I have an existing website that I need to develop a small portion of
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I have to develop a small application that will connect to a Linux server
For my work I have to develop a small Java application that parses very
If i have to develop a small CRM application, why would i choose ASP.NET
I'm using BerkeleyDB to develop a small app. And I have a question about
I have to develop a application (Winforms-application) which is connected to a database within

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.