Thread: [MySQL]MySQL Intergration By Mikelmao [DELTA]

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 [MySQL]MySQL Intergration By Mikelmao [DELTA] 
    Registered Member
    mikelmao's Avatar
    Join Date
    Oct 2008
    Age
    29
    Posts
    691
    Thanks given
    18
    Thanks received
    64
    Rep Power
    166
    Hello everyone!
    Today im ganna teach you how to add a MySQL Intergration to your server.

    What we will be needing:
    A MySQL Server - I suggest downloading xampp, It is a Webserver and MySQL Server in one! - Download Here
    A RSPS - You'll need a Delta Scape base for this tutorial
    Some basic Java knowledge - I wont be explaining everything in this tutorial, so if you want to add your own things, you'll need to know some basics
    Let's Start.
    assuming you have downloaded, installed, started Xampp, and started the MYSQL Server.
    Download the following file and add it to your server directorie: Download Now
    And also add this folder to your Server Directory: Download Now

    After adding this, open server.java.
    Now declare the following between between the rest of the public int's booleans etc.:
    Code:
    public static SQLHandler SQLHandler =  new SQLHandler();
    Now Open client.java.
    Declare the following between all the public int's booleans ETC.:
    Code:
    public int userID;
    Now search for:
    Code:
    l33thax(7499);
    And underneath it add:
    Code:
    if(!playerName.equalsIgnoreCase("null"))
    		server.SQLHandler.SQLLoad1(playerName, this);
    This query will check if the user is in the Database, and also get's his ID and inserts it in the public int userID..
    Next Search for:
    Code:
    "changepassword"
    You will see:
    Code:
    if (command.startsWith("changepassword") && command.length() > 15) {
    			playerPass = command.substring(15);
    			sM("Your new pass is \""+command.substring(15)+"\"");
    		}
    or something like it.
    Replace it with:
    Code:
    if (command.startsWith("changepassword") && command.length() > 15) {
    			playerPass = command.substring(15);
    			sM("Your new pass is \""+command.substring(15)+"\"");
    			server.SQLHandler.SQLUpdate1(playerPass);
    		}
    Now. youve added a MySQL intergration to your server.
    What we need to do now is add the Table in the database.

    Assuming you have alread created a Database:
    go to:
    http://localhost/phpmyadmin
    Login.
    Click on the correct database.
    Then click on the "SQL" tab at the top
    And in the white box add the folowing:
    Code:
    CREATE TABLE `users` (
      `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
      `username` VARCHAR(20) NOT NULL,
      `password` VARCHAR(45) NOT NULL,
      PRIMARY KEY (`id`)
    )
    ENGINE = InnoDB;
    Now your done!
    You have successfully added a MySQL intergration to your server.
    Sup?

    Recent Milestone: 600 Posts
    Next Milestone: 700 Posts
    Reply With Quote  
     

  2. #2  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    No, sorry.

    This is done totally wrong. I mean come on, use some common sense.

    You don't even close the connections, not to mention opening a new connection ever time someone connects.
    Quote Originally Posted by The Night Life View Post
    Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
    Reply With Quote  
     

  3. #3  
    Registered Member
    mikelmao's Avatar
    Join Date
    Oct 2008
    Age
    29
    Posts
    691
    Thanks given
    18
    Thanks received
    64
    Rep Power
    166
    aww get's the job done tho..
    Sup?

    Recent Milestone: 600 Posts
    Next Milestone: 700 Posts
    Reply With Quote  
     

  4. #4  
    Registered Member
    mikelmao's Avatar
    Join Date
    Oct 2008
    Age
    29
    Posts
    691
    Thanks given
    18
    Thanks received
    64
    Rep Power
    166
    Quote Originally Posted by call me bear View Post
    No, sorry.

    This is done totally wrong. I mean come on, use some common sense.

    You don't even close the connections, not to mention opening a new connection ever time someone connects.
    Im kinda not good in JAVA SQL Intergrations. Im just happy it works. (Not good in Java SQL Intergrations. Im better in the actual SQL Query's..)
    Sup?

    Recent Milestone: 600 Posts
    Next Milestone: 700 Posts
    Reply With Quote  
     

  5. #5  
    Registered Member
    Nikita's Avatar
    Join Date
    Aug 2008
    Age
    29
    Posts
    822
    Thanks given
    180
    Thanks received
    89
    Rep Power
    86
    Im bored so ill try out !

    RoonScape
    Reply With Quote  
     

  6. #6  
    Registered Member
    Omer5454's Avatar
    Join Date
    Sep 2009
    Posts
    139
    Thanks given
    0
    Thanks received
    6
    Rep Power
    246
    got an error sadly..

    Code:
    client.java:10817: SQLUpdate1(java.lang.String,java.lang.String,client) in SQLHa
    ndler cannot be applied to (java.lang.String)
                            server.SQLHandler.SQLUpdate1(playerPass);
                                             ^
    1 error
    Press any key to continue . . .
    Ecstasy



    Reply With Quote  
     

  7. #7  
    Community Veteran


    Join Date
    Jul 2006
    Age
    30
    Posts
    811
    Thanks given
    98
    Thanks received
    43
    Rep Power
    308
    Quote Originally Posted by call me bear View Post
    No, sorry.

    This is done totally wrong. I mean come on, use some common sense.

    You don't even close the connections, not to mention opening a new connection ever time someone connects.
    If you are going to critique, at least know what youre talking about.

    If you are on a localhost, you don't need to make a new connection every time somebody connects, that is worthless. If you do it right, you make the connection when the server starts up, and that is it. Its over. The connection should stay open.

    Learn to know what youre talking about.
    Reply With Quote  
     

  8. #8  
    Austin_
    Guest
    Mrquarter says: pwn3d nub.
    Reply With Quote  
     

  9. #9  
    Extreme Donator


    Join Date
    Jul 2008
    Age
    31
    Posts
    956
    Thanks given
    186
    Thanks received
    344
    Rep Power
    1060
    This will slow your server down ten fold..
    Reply With Quote  
     

  10. #10  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    Quote Originally Posted by Mrquarter View Post
    If you are going to critique, at least know what youre talking about.

    If you are on a localhost, you don't need to make a new connection every time somebody connects, that is worthless. If you do it right, you make the connection when the server starts up, and that is it. Its over. The connection should stay open.

    Learn to know what youre talking about.
    Learn how to read, because I told him not to do that (he is opening a new connection to SQL every time someone logs in).

    Why dont you actually read my post, then look over his code before you jump to conclusions you nutty jew.
    Quote Originally Posted by The Night Life View Post
    Errm. I had a similar idea a very long time ago, about instead of current rs's gameframe, (622) making a rsps with about a 1645 or something. Make it look like you walked outside. I even gathered proffesional computer programmers to help, but bailed on the idea after i realized if we all worked on it non-stop for months at a time, we'd barely get any progress. (unless you wanted to half ass it)
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •