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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:43:07+00:00 2026-05-18T19:43:07+00:00

Exception in thread main java.lang.ClassCastException: org.apache.derby.client.am.Statement cannot be cast to java.beans.Statement at CollegeLibrary.NotRegistered.DBStatement(NotRegistered.java:114) at

  • 0
Exception in thread "main" java.lang.ClassCastException: org.apache.derby.client.am.Statement cannot be cast to java.beans.Statement
        at CollegeLibrary.NotRegistered.DBStatement(NotRegistered.java:114)
        at CollegeLibrary.NotRegistered.<init>(NotRegistered.java:85)
        at CollegeLibrary.NotRegistered.main(NotRegistered.java:91)
Java Result: 1

with and error on the within these section

 ResultSet SelectQuery(Statement st) {
        ResultSet rs = null;
        try {
            rs = st.executeQuery("select * from APP.STUDENT");
        } catch (SQLException ex) {
            Logger.getLogger(NotRegistered.class.getName()).log(Level.SEVERE, null, ex);
        }
        return rs;
    }


    void InsertQuery(Statement st) {

        try {
            if(_txtFname.getText().length()>0 & _txtLname.getText().length()>0& _txtAddress.getText().length()>0&_txtPhone.getText().length()>0&_txtDob.getText().length()>0&_txtSTcode.getText().length()>0){

    st.executeQuery("insert into APP.STUDENT values ('"+_txtFname.getText()+"','"+_txtLname.getText()+"','"+_txtAddress.getText()+"','"+_txtPhone.getText()+"','"+_txtDob.getText()+"','"+_txtSTcode.getText()+"')");
            }else{
                System.out.println("please fill up the form");
            }
              } catch (SQLException ex) {
            Logger.getLogger(NotRegistered.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
void  UpdateQuery(Statement st) {

        try {
            if(_txtFname.getText().length()>0 & _txtLname.getText().length()>0){
            st.executeUpdate("update APP.STUDENT SET USERNAME='"+_txtFname.getText()+
                    "', PASSWORD='"+_txtLname.getText()
                    +"' where USERNAME='"+_oldData+"'");
            }else{
                System.out.println("please fill up the form");
            }
              } catch (SQLException ex) {
            Logger.getLogger(NotRegistered.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
void  DeleteQuery(Statement st) {

        try {
            if(_txtFname.getText().length()>0 & _txtLname.getText().length()>0& _txtAddress.getText().length()>0&_txtPhone.getText().length()>0&_txtDob.getText().length()>0&_txtSTcode.getText().length()>0){
                System.out.println(" ");
            st.executeUpdate("delete from APP.STUDENT where USERNAME='"+_oldData+"'");
            }else{
                System.out.println("please fill up the form");
            }
              } catch (SQLException ex) {
            Logger.getLogger(NotRegistered.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
  • 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-18T19:43:08+00:00Added an answer on May 18, 2026 at 7:43 pm

    java.lang.ClassCastException: org.apache.derby.client.am.Statement cannot be cast to java.beans.Statement

    I think you have the wrong import statement in your code.

    There are java.sql.Statement (which you want here), and java.beans.Statement (which is something completely different).

    I most cases, you want to use java.sql.PreparedStatement instead anyway, which steps around the name conflict, too. Don’t put literal values directly in the SQL, use bind variables.

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

Sidebar

Related Questions

I keep getting a ClassCastException Exception in thread main java.lang.ClassCastException: java.lang.String cannot be cast
Here is the error: Exception in thread main java.lang.NoClassDefFoundError: org/alicebot/server/net/AliceServer Caused by: java.lang.ClassNotFoundException: org.alicebot.server.net.AliceServer
Here is my error message: Exception in thread main java.lang.IllegalArgumentException: n must be positive
I am getting something like the following: Exception in thread main java.lang.UnsatisfiedLinkError: no viewerNativeDLL
I have code to upload a file to a server. import org.apache.commons.net.ftp.FTPClient; import java.io.File;
I have thread exception handler which saves the exception stack trace and should close
I am getting a Thread was being aborted Exception in an ASP.NET page.I am
I get this exception when i try to cast an Object array to a
Why does the following happen and how can I fix it? Exception in thread
I have Java code that connects to an SQL server DB but I cannot

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.