Results 1 to 2 of 2
  1. #1
    sweetvalley is offline Member
    Join Date
    Mar 2016
    Rep Power

    Default eBay JDBC - Null pointer exception

    I am attempting to download the results from eBay GetSellerTransactions, and insert the results in an Access database. I am able to return results into a Java table, however, I can't seem to find how to insert the results into an Access database. The ODBC connection is fine in a test example, so I think the error is not the connection to the database, but rather pulling the data from eBay.

    With this code, I am receiving a null pointer exception:

    Java Code:
       public void UpdateAccess() throws Exception{
             Connection con=null;
             PreparedStatement stamt=null;
             String dataSourceName = "JdbcOdbc";
             String dbURL = "jdbc:odbc:" + dataSourceName;
             con = DriverManager.getConnection(dbURL);
             StringBuilder insertQuery=new StringBuilder("INSERT INTO tblTest ")
                     .append("(TestField) ")
                     .append("VALUES (?);");
             //Null pointer exception starts here I believe
             TransactionType transa = new TransactionType();
             UserType buyer = transa.getBuyer();
             String FirstName = buyer.getUserFirstName();
             stamt.setString(0, FirstName); 
                    catch (Exception err) {
                 System.out.println("ERROR: " + err);
                 try{con.close();} catch(Exception e){System.out.println("ERROR: " + e);}}

    This is how I am calling this method, after the display results Java command:

    Java Code:
          // Display results.
               this.txtHasMoreItems.setText(api.getHasMoreTransactions() ? "yes" : "no");
                 pnresult.getTotalNumberOfPages() == null ? "" : pnresult.getTotalNumberOfPages().toString());
               String actualCountTxt = new Integer(api.getReturnedTransactionCountActual()).toString();
               //Update Access

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: eBay JDBC - Null pointer exception

    Please don't post the same question multiple times on the forum.
    I'm closing this one.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. eBay JDBC - Null pointer exception
    By sweetvalley in forum JDBC
    Replies: 1
    Last Post: 03-22-2016, 09:24 AM
  2. Why do i get a null pointer exception
    By SpockVulcan in forum New To Java
    Replies: 8
    Last Post: 08-09-2013, 10:19 AM
  3. null pointer exception
    By Herah in forum New To Java
    Replies: 1
    Last Post: 12-01-2011, 08:44 AM
  4. Jdbc null pointer exception
    By miko5054 in forum New To Java
    Replies: 3
    Last Post: 02-24-2011, 12:06 PM
  5. null pointer exception
    By marvelk in forum Advanced Java
    Replies: 8
    Last Post: 02-01-2011, 09:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts