Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
/ English-for-Dream Public archive

โปรแกรมฝึกภาษาอังกฤษ

License

Notifications You must be signed in to change notification settings

PskDream/English-for-Dream

Repository files navigation

English-for-Dream

Project Java OOP (IT59118)
Computer Engineering , Panyapiwat Institute Of Management

Database

Table : DATA

Column Type Schema
ID INTEGER PK , AUTOINCREMENT
vocab TEXT NOT NULL , UNIQUE
meaning TEXT NOT NULL
Database Power SQlite

SQlite JAR File : https://bitbucket.org/xerial/sqlite-jdbc/downloads/

Learning for Database

Database Class

Insert Data

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        db.insert.insertData("Dream", "ความฝัน");
        db.close();
    }
}

Select Data For Table

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        ArrayList <Object> data = db.select.getTable();  //retrun ArrayList type Object
        db.close();
    }
}

Select Data For Column

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        ArrayList <Object> data = db.select.getColumn("vocab"); //retrun ArrayList type Object
        db.close();
    }
}

Select Data For Row

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        ArrayList <Object> data = db.select.getRow("vocab","Dream"); //retrun ArrayList type Object
        db.close();
    }
}

Select Query

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        ArrayList <Object> data = db.select.query("SQL Command"); //retrun ArrayList type Object
        db.close();
    }
}

Delete

public static void main(String[] args) {
        Database db = new Database("jdbc:sqlite:data.db");
        db.connect();
        db.delete.delete("text"); //delete WHERE vocab
        db.close();
    }
}

Translate

Translate by Google API

Learning for Database

public static void main(String[] args) {
        Translate translator = new Translate("API KEY");
        String text = translator.translate("My name is Dream", "en", "th");
        System.out.println(text);
    }
}

TTS

text to speech by free tts

public static void main(String[] args) {
        TextToSpeech tts = new TextToSpeech();
        tts.speak("My name is Dream");
    }
}

About

โปรแกรมฝึกภาษาอังกฤษ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages