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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:31:32+00:00 2026-06-12T05:31:32+00:00

I created this method, but when i try to call the method it returns

  • 0

I created this method, but when i try to call the method it returns a null pointer exception. Can anybody tell me what’s wrong? help me please

public Talent SearchTalentQuery(int talentID){
    String SearchTalentString = "SELECT * FROM TALENT WHERE TALENTID = "+talentID+";";
    Talent talent=null;
    try{
        //error in select query
        if(getOracleXEConnection()!=null){

            Statement statement = conn.createStatement();
            ResultSet rs = statement.executeQuery(SearchTalentString);                       
                   while( rs.next()){
                   talent.setTalentName(rs.getString("talentname"));
                   talent.setTalentFocus(rs.getString("maintalentfocus"));
                   talent.setTalentNationality((rs.getString("nationality")));
                   talent.setTalentGroup(rs.getString("talentgroup"));
                   talent.setTalentHiredate(rs.getString("hiredate"));
                   talent.setTalentAge(Integer.parseInt(rs.getString("age")));
                   talent.setTalentID(Integer.parseInt(rs.getString("talentid")));
                   }

            rs.close();
            statement.close();
            conn.close();


            return talent;
        }
        else{
            return null;
        }
    }
    catch(SQLException | NumberFormatException e){
        e.printStackTrace();
    }
    return null;
  • 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-12T05:31:33+00:00Added an answer on June 12, 2026 at 5:31 am

    Because your whole code does not initialize memory for talent object. you need to initialize memory for talent object.

    use:
    Talent talent= new Talent();
    at the place of
    Talent talent = null;

    It might solve your problem.

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

Sidebar

Related Questions

Can a custom event be created for any object method? To do this do
The api for ServletContext#getRequestDispatcher() says: This method returns null if the ServletContext cannot return
I'v created a Contentprovide and implements it's update() method like this: @Override public int
I have this method call: public DataTemplate Create(Type type, string propertyName) { string str
I'm creating new Site Definitions using this method: http://weblogs.asp.net/paulballard/archive/2007/04/09/creating-a-custom-sharepoint-2007-portal-site-definition-using-the-portalprovisioningprovider-class.aspx and when they get created,
This is my json response : [{customer:{account_id:1,account_number:null,alt_contact:null,alt_phone:null,alt_phone_number:,balance:null,billing_address:341234 sucka ma cocka,billing_city:apple,billing_country:,billing_state:nj,billing_zip_code:021231,company_name:null,contact:null,created_at:2012-03-08T06:02:38-08:00,created_by:1,credit_limit:null,custom_datetime1:null,custom_datetime10:null,custom_datetime2:null,custom_datetime3:null,custom_datetime4:null,custom_datetime5:null,custom_datetime6:null,custom_datetime7:null,custom_datetime8:null,custom_datetime9:null,custom_number1:null,custom_number10:null,custom_number2:null,custom_number3:null,custom_number4:null,custom_number5:null,custom_number6:null,custom_number7:null,custom_number8:null,custom_number9:null,custom_text1:null,custom_text10:null,custom_text11:null,custom_text12:null,custom_text13:null,custom_text14:null,custom_text15:null,custom_text16:null,custom_text17:null,custom_text18:null,custom_text19:null,custom_text2:null,custom_text20:null,custom_text3:null,custom_text4:null,custom_text5:null,custom_text6:null,custom_text7:null,custom_text8:null,custom_text9:null,customer_number:151,customer_source_id:4,customer_type_id:2,customer_type_ref_full_name:null,delivery_method:null,edit_sequence:null,email:null,email_address:apple@adsfsd.com,fax:,first_name:null,full_name:123 Landscaping,id:431,is_active:null,is_statement_with_parent:null,item_sales_tax_ref_full_name:null,item_sales_tax_ref_list_id:null,job_desc:null,job_end_date:null,job_projected_end_date:null,job_start_date:null,job_status:null,job_type_ref_full_name:null,last_name:null,list_id:null,mobile:null,name:123 Landscaping,pager:null,parent_id:null,parent_ref_list_id:null,password:null,phone:234234234,phone_number:234234234,preferred_payment_method_ref_full_name:null,price_level_ref_full_name:null,qb_parent_list_id:null,resale_number:null,sales_rep_ref_full_name:null,sales_tax_code_ref_full_name:null,sales_tax_code_ref_list_id:null,service_address:341234 sucka ma
This method works as expected - it creates a JTree with a root node
I'd like to use this method to create user-friendly URL. Because my site is
Trying to use GridBagLayout. I have the method called buildLabel. This creates three label.
I want to create an extension method like this public static bool AllConsecutives(this IEnumerable<int>

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.