I have Created a Tic tac toe game a also made a player record GUI where it takes the 2 players data
II have Created a Tic tac toe game a also made a player record GUI where it takes the 2 players data means there names and also connected those data with my SOL but whenever a player wins or the game ends no data was inserting into my sql schema .. I have checked everything but fail to find out the error .. so if anyone knows about it so please help me >>>> Here is the code
https://sourceb.in/tGtZQbJWs9
10 Replies
⌛
This post has been reserved for your question.
Hey @Danix! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
main
is never initialised inside TicTacToe
or never passed
what i would recommend is breaking out the sql stuff into a new third class called e.g. PlayerTracking
that is only responsible for the database stuff, and instantiating that in TicTacToe
also you are comparing strings with ==
which is not right; you should use .equals
for comparing strings in javaif you are having the sql stuff inside
main
because that's where the player names are, you can pass those into TicTacToe
's constructor so they are available there and you can do the sql stuff inside there (or pass them further into the breakout new third class i suggested)Stack Overflow
Java: how to pass arguments into constructor? Undefined method error?
Ok, so I'm in need of some basic help. Here's the tutorial I'm trying to learn from (http://docs.oracle.com/javase/tutorial/java/javaOO/classes.html), but I'm confused as to how to actually pass data
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
Ok everything is fine now but I still have one issue I want to track the winner and also insert the winner history of every game in my database but am not getting any logic to build it .. if u have any idea so please help me
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Hmm
I will try to do it
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.