Which is the best file system to save prices and transactions?

Discussion in 'Plugin Development' started by Schwarzer Zylinder, Oct 15, 2011.

Thread Status:
Not open for further replies.
  1. Hey, I want to expand my shop plugin. Until now, I used a .cfg file to save prices, but now I want to save all transactions, too.
    Which is the best file system for a log file?

    Thanks.
     
  2. Offline

    nala3

    MySQL
    Just create a table with things like.
    that way to ad a new record you can just insert the each piece of data into the table and its easily accessible and quick too
     
  3. Yeah, I really want to use MySQL, but I didn't get it.
    Maybe you can answer me some simple questions:
    WHAT can you save in an MySQL? Only text, which I can get as String?
    And does somebody know a tutorial how to write in MySQL? Because I only found tuts for reading...
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    Section from the manual.
    http://dev.mysql.com/doc/refman/5.0/en/data-types.html

    As for inserting rows
    http://www.w3schools.com/sql/sql_insert.asp

    EDIT:
    IF you just plan on logging transactions. A SQL table is overkill for that.
     
  5. Offline

    nala3

    http://www.vogella.de/articles/MySQLJava/article.html
    should help a bit :) (for java)

    Well actually it depends on how many :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  6. 1. Thats how to add rows via MySQL-Commands, how to use in java?

    2. Well, I have many simple things to save: Prices, easy logs and so on
    So I could do this in different files like txt or cfg or in MySQL.
    But what file could I use? How can I read a txt file?
     
  7. Offline

    nala3

    did you even look at my link XD
     
  8. Sure ;) But it's again, only how to read a file :(
     
  9. Offline

    nala3

    Code:
    create database feedback;
    use feedback;
    CREATE USER sqluser IDENTIFIED BY 'sqluserpw';
    grant usage on *.* to sqluser@localhost identified by 'sqluserpw';
    grant all privileges on feedback.* to sqluser@localhost;
    
    CREATE TABLE COMMENTS (
            id INT NOT NULL AUTO_INCREMENT,
            MYUSER VARCHAR(30) NOT NULL,
            EMAIL VARCHAR(30),
            WEBPAGE VARCHAR(100) NOT NULL,
            DATUM DATE NOT NULL,
            SUMMERY VARCHAR(40) NOT NULL,
            COMMENTS VARCHAR(400) NOT NULL,
            PRIMARY KEY (ID)
        );
    
    INSERT INTO COMMENTS values (default, 'lars', '[email protected]','http://www.vogella.de', '2009-09-14 10:33:11', 'Summery','My first comment' );
    and then

    http://www.rgagnon.com/javadetails/java-0109.html
     
  10. Thats not Java.
     
  11. Offline

    nala3

    herp derp. lol my bad that just SQL
     
Thread Status:
Not open for further replies.

Share This Page