• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lost MySQL DB

 
Stewen Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok recently i bought game that have been made with Java. The guy who sell me the game was set-up everything noob friendly for me. All i was have to do is run xampp and run the jar. Yesterday i accidentaly clicked something and i drop my mysql database. I have a .class file in the sources called MySQLQueries.class which contains all the tabes, colums, etc that have to be maded. So basicaly what i have to do is to create new DB and add the tables/colums, but i don't really understand the code, so im looking forward for someone to help me, please! Thanks in advance!
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do you know how to import queries from .sql file to mysql db?

if no follow this link

come back if your problem not solved
 
Stewen Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have .sql file. My queries are into a file called QueryManager.java
I can list the source of that file if it will help and if possible to tell me what to do and how to import that queries into a new db.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if you have source file store all that queries in the notepad
->Save it using .sql extension
->import that file in your db

Hope it help you
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the game has come with code that sets up the database then can't you simply launch the code from scratch?
You've lost your db, so presumably the lack of a db is what the code uses to determine whether to create one...otherwise what's the point of having the creation SQL in the code?
 
Stewen Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the code of my QueryManager.java file:



I believe i can't copy/paste that and import it as a sql query, so what should i do with it ?
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing in there to do with setting up a database.
It's all SELECT and UPDATE statements (even in the commented out section).
 
Stewen Johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:There's nothing in there to do with setting up a database.
It's all SELECT and UPDATE statements (even in the commented out section).


Dude im kinda noob in Java. Can you tell me what is that mean and what exactly i have to do ? Like step by step, please. Thank you!
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said you accidentally dropped the database.
The code you supplied above is nothing to do with setting up a database, so is not what you need.

Since you apparently were given everything for setting up this game then can't you simply redo whatever steps were needed and start from scratch?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic