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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:09:54+00:00 2026-05-27T20:09:54+00:00

I have big problem with my small database(DERBY) application. I am getting such an

  • 0

I have big problem with my small database(DERBY) application. I am getting such an error when I click the button:

2011-12-25 04:21:38 com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.NullPointerException
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:532)
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
    at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
    at com.vaadin.ui.Button.fireClick(Button.java:550)
    at com.vaadin.ui.Button.changeVariables(Button.java:217)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1445)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1393)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1312)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
    at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
    at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
    at com.example.expert_system.Knowledge.insertPhone(Knowledge.java:280)
    at com.example.expert_system.Knowledge.buttonClick(Knowledge.java:262)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
    ... 27 more

I am getting this only when I am trying to call the method from class Database_engine.

Database_engine.java :

private static String dbURL = "jdbc:derby://localhost:1527/Knowledge;create=true;user=erni;password=2ngxc3";
private static String tableName = "ERNI.PHONE";
private static Connection conn = null;
private static Statement stmt = null;




private void createConnection()
{
    try
    {
        Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
        //Get a connection
        conn = DriverManager.getConnection(dbURL); 
    }
    catch (Exception except)
    {
        except.printStackTrace();
    }
}


public void insertPhone(String producer, String model, String construction, String display_size, String system)
{

    createConnection();
    try
    {
        stmt = conn.createStatement();
        stmt.execute("insert into " + tableName + "(\"producer\",\"model\", \"construction\",\"dispaly_size\",\"system\") values (" + producer + "','" + model + "','" + construction + "','" + display_size + "','" + system +"')");
        stmt.close();
        //INSERT INTO ERNI.PHONE ("producer", "model", "construction", "display_size", "system") VALUES ('placek', 'na', 'oleju', 'mama ', 'krzyczy');

    }
    catch (SQLException sqlExcept)
    {
        sqlExcept.printStackTrace();
        //System.err.println("Exception: "+sqlExcept.getMessage());
    } finally {
        closeConnection();
    }

}



private void closeConnection()
{
    try
    {
        if (stmt != null)
        {
            stmt.close();
        }
        if (conn != null)
        {
            DriverManager.getConnection(dbURL + ";shutdown=true");
            conn.close();
        }           
    }
    catch (SQLException sqlExcept)
    {

    }

}

And the code of form methods:

public void buttonClick(ClickEvent event) {
        Button source = event.getButton();
      //  
       if (source == button_2) {


            insertPhone();
            getWindow().showNotification("Open " + producerBox.getValue().toString() +" "+ 
                     model.getValue().toString()+" "+ 
                     constructionBox.getValue().toString()+" "+ 
                     displayBox.getValue().toString()+" "+ 
                     systemBox.getValue().toString());

            setReadOnly(true);  
            getWindow().showNotification(systemBox.getInputPrompt());
        } else if (source == button_1) {
            discard();
            setReadOnly(true);
            getWindow().showNotification("clear executed");
        }
    }

    private void insertPhone() {
        Database_engine addPhone = new Database_engine();
        addPhone.insertPhone(producerBox.getValue().toString(), 
                             model.getValue().toString(), 
                             constructionBox.getValue().toString(), 
                             displayBox.getValue().toString(), 
                             systemBox.getValue().toString());

    }
    private void discard() {
        producerBox.setValue(null);
        model.setValue("");
        constructionBox.setValue(null);
        displayBox.setValue(null);
        systemBox.setValue(null);
        otherColSelect.setValue(null);
        comColSelect.setValue(null);

    }

Please tell me what am I doing wrong.


Ok I have checked all things you suggested.
When I debug the code I got such an answer “source not found”

I wrote an main method to test the class and I am getting:

org.apache.derby.client.am.SqlException: Syntax error: Encountered "\',\'" at line 1, column 83.
    at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
    at org.apache.derby.client.am.Statement.completeExecuteImmediate(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.parseEXCSQLIMMreply(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.readExecuteImmediate(Unknown Source)
    at org.apache.derby.client.net.StatementReply.readExecuteImmediate(Unknown Source)
    at org.apache.derby.client.net.NetStatement.readExecuteImmediate_(Unknown Source)
    at org.apache.derby.client.am.Statement.readExecuteImmediate(Unknown Source)
    at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
    at org.apache.derby.client.am.Statement.executeX(Unknown Source)
    at org.apache.derby.client.am.Statement.execute(Unknown Source)
    at com.example.expert_system.Database_engine.insertPhone(Database_engine.java:56)
    at com.example.expert_system.Database_engine.main(Database_engine.java:24)

line 56 is stmt.execute("insert into " + tableName + " (producer, model, construction, display_size, system) values (" + db_producer + "','" + db_model + "','" + db_construction + "','" + db_display_size + "','" + db_system +"')");

But there is everything OK. I think so?

Any suggestions ??

  • 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-27T20:09:54+00:00Added an answer on May 27, 2026 at 8:09 pm

    As it says your SQL has a syntax error. In your SQL you have:

    … values (” + db_producer + “‘,'” …

    which contains an unmatched single quote.

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

Sidebar

Related Questions

I'm currenty writing small application for image processing. However I have a big problem
i have problem arranging the numbers from small to big. Im trying to overide
I have a big problem writing a small piece of code using JS/jQuery (don't
I have big problem when I am trying to deploy my app over clickonce.
I have a big problem. I want to extract text from html table that
I have a (big) problem that all of you that work with Webforms might
I have a big problem dealing with data I try to download in my
I have an big problem with an SQL Statement in Oracle. I want to
I am using gettext in my PHP code, but I have a big problem.
I have a very big problem. I am making a CRM (Costumer Relationship Management)

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.