Package com.anlavn.net
Class SQL
java.lang.Object
com.anlavn.net.SQL
The SQL class supports to connect, execute mySQL and SQL server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidConnect()Use this method to connect your Database.final ConnectionUse this method to get connection of SQL.final booleanUse this method to check the connection of SQL is null.final ResultSetUse this method to execute Query with multiple arguments Object Varargs.final intUse this method to execute Update Query with multiple arguments Object Varargs.
-
Constructor Details
-
SQL
Create a SQL connect with full information.- Parameters:
DB_url- is Database URL to connect.DB_username- is Database Username.DB_password- is Database Password.
-
-
Method Details
-
isConnectNull
public final boolean isConnectNull()Use this method to check the connection of SQL is null.- Returns:
trueif SQL connection is null,falsein the opposite.
-
getConnect
Use this method to get connection of SQL.- Returns:
- Connection of your SQL.
-
Connect
Use this method to connect your Database. -
Update
Use this method to execute Update Query with multiple arguments Object Varargs.- Parameters:
Query- is a String SQL Query statement.args- is array multiple arguments Object Varargs.- Returns:
- number of row affected after execute the Query.
- See Also:
-
Query
Use this method to execute Query with multiple arguments Object Varargs.- Parameters:
Query- is a String SQL Query statement.args- is array multiple arguments Object Varargs.- Returns:
- a Result Set after execute the Query.
- See Also:
-