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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:45:23+00:00 2026-06-16T03:45:23+00:00

code: public int getLastGotKill() { Connection con = null; int last_pvp_time = 0; try

  • 0

code:

public int getLastGotKill()
{
    Connection con = null;
    int last_pvp_time = 0;
    try
    {
        con = L2DatabaseFactory.getInstance().getConnection(false);
        PreparedStatement statement;
        statement = con.prepareStatement("select last_got_kill from characters where obj_Id=?");
        statement.setInt(1, getObjectId());

        ResultSet rset = statement.executeQuery();
        while(rset.next())
        {
            last_pvp_time = rset.getInt("last_got_kill");
            _log.info("last pvp time is : " + last_pvp_time);
        }
        rset.close();
        rset = null;
        statement.close();
        statement = null;
    }
    catch(Exception e)
    {
        if(Config.ENABLE_ALL_EXCEPTIONS)
            e.printStackTrace();
    }
    finally
    {
        CloseUtil.close(con);
        con = null;
    }
    return last_pvp_time;
}

so when i call this function it gets into the while loop inside the try{} but when i try to print the value of the selected column it prints 0 and so it returns 0…

last_got_kill column in characters table is a bigint(20) type

i can see that there is a number in that column ex. 4294967295 which are

But why do i always get 0 back?

  • 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-16T03:45:24+00:00Added an answer on June 16, 2026 at 3:45 am

    you have to get a long instead . as your number exceeds int range.

    Integer.MAX_VALUE is 2147483647 which is surely less than 4294967295
    Long.MAX_VALUE however is 9223372036854775807 seems to suit your case.

       long last_pvp_time = rset.getLong("last_got_kill");
    

    should work.

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

Sidebar

Related Questions

Let's say you have the following code: public int getSpeedX() { speedLock.lock(); try {
Consider the following code: public int heightOfBinaryTree(Node node) { if (node == null) {
I would like to try this code: public struct Direction { private int _azimuth;
Sample code: public class Service1 { public int Service1() { .... } } public
Ok I currently have this code public int i = 0; //this is outside
In c#, Given the following code: public class Person { public int PersonID {
First code : public static int pitagoras(int a, int b) { return (int) Math.sqrt(a*a
I have the code below : public class Anything { public int Data {
here is the original code: public static int getInt () { Scanner in =
So here is my code: public MyClass (int y) { super(y,x,x); //some code }

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.