Package net.risingworld.api.database
Schnittstelle WorldDatabase
public interface WorldDatabase
Provides access to the current world database.
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypSchnittstelleBeschreibungstatic enum
Represents a particular world database. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Executes the given SQL statement, for example a CREATE or DELETE statement.executeQuery
(String sql) Executes the given SQL statement and returns aResultSet
object.
Remember to close the ResultSet once you're ready.void
executeUpdate
(String sql) Executes the given SQL statement, which may be an INSERT, UPDATE or DELETE statement.Gets the database name.getPath()
Gets the path to the database file.
-
Methodendetails
-
getDatabaseType
DatabaseType getDatabaseType() -
getPath
String getPath()Gets the path to the database file.- Gibt zurück:
- the full path to the database file.
-
getDatabaseName
String getDatabaseName()Gets the database name.- Gibt zurück:
- the database name.
-
execute
Executes the given SQL statement, for example a CREATE or DELETE statement.
Please note: In order to synchronize any commits to the database, this statement may be executed with a minor delay (usually just a few ticks)- Parameter:
sql
- the SQL statement.- Example: Create a new table in world database
-
executeUpdate
Executes the given SQL statement, which may be an INSERT, UPDATE or DELETE statement.
Please note: In order to synchronize any commits to the database, this statement may be executed with a minor delay (usually just a few ticks)- Parameter:
sql
- the SQL statement, INSERT, UPDATE or DELETE.- Example: Delete a player from player database
-
executeQuery
Executes the given SQL statement and returns aResultSet
object.
Remember to close the ResultSet once you're ready.- Parameter:
sql
- the SQL statement, typically a SELECT statement.- Gibt zurück:
- a ResultSet object containing the data produced by the given SQL statement.
- Löst aus:
SQLException
- If a database access error occurs.- Example: Read player data from database
-