The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Small problem, help please?

java.lang.NullPointerException
at server.util.MysqlManager.checkVote(MysqlManager.java:43)
at server.model.players.Client.initialize(Client.java:81)
at server.model.players.PlayerHandler.process(PlayerHandler.java:186)
at server.Server.main(Server.java:176)

Re: Small problem, help please?

I don't know what you mean.

Do you know what a program variable is?
For example in the following line of code var is the variable and doSomething is a method:
var.doSomething()
If var has a null value you will get a NullPointerException on that line.

Look at line 43 in MysqlManager.java
What variables are on that line that can be null?
Add a println to print out the values of all that variables used on that line. For example for the line I showed above, I'd add this just before the line to show the value of var:
System.out.println("var=" + var);

Re: Small problem, help please?

Where does the variable conn get assigned a value?
The error message says it has a value of null. It needs to have a valid value that points to an object of the class that has the createStatement method.

Re: Small problem, help please?

Do you have MSN/Skype so we could chat on there?

If wouldn't do you any good. I would tell you the same thing. Read the tutorial and get an understanding about what a database is and how to use it.
There is a LOT to learn before you can write this program. There is no quick, easy short cut.

Re: Small problem, help please?

I gave you the Big Index because you will be needing it for lots of Java programming problems.
Starting from the Big Index you can find the section where need specific information for today's problem.
Tomorrow with another problem, you'll start with the Big Index again, find the section you need help with and read from there.

If I'd given you the index to the page with the Connection class info. Tomorrow some one would have to give you the index to the page with the LinkedList class info. Next day the link to the page with the Painting info.
You can now find all that yourself by starting at the Big Index.
I hope that is not too hard for you to do.