repositories {
mavenCentral()
}
dependencies {
compile 'net.neyrowz.orm:mysql-orm:1.0.0'
}
<dependency>
<groupId>net.neyrowz.orm</groupId>
<artifactId>mysql-orm</artifactId>
<version>1.0.0</version>
</dependency>
- Host:
localhost:3306
- Database:
dev
- Username:
neyrowz
- Password:
12345six
public class PlayerDataManager extends DataManager<UUID, PlayerData> {
public PlayerDataManager() {
super("playerData", new Mysql(new Credentials("localhost:3306", "dev", "neyrowz", "")));
}
@Override
public String getId(UUID id) {
return id.toString(); // Allow you to format the string key saved in the database.
}
}
Note You can also use credentials from a json file.
new Credentials("localhost:3306", "dev", "neyrowz", "")
.fromJson(new File(".../path/credentials.json"));
{
"host": "localhost:3306",
"database": "dev",
"username": "neyrowz",
"password": "12345six"
}