= Statement type updates
This commit is contained in:
@@ -7,6 +7,8 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import jdk.nashorn.internal.runtime.logging.DebugLogger;
|
||||
import utils.GlobalLog;
|
||||
import utils.LogFilter;
|
||||
|
||||
@@ -119,6 +121,7 @@ public class JDBCDriverSQLite extends JDBCDriver
|
||||
if(args != null && args.length > 0)
|
||||
{
|
||||
PreparedStatement statement = connection.prepareStatement(command);
|
||||
GlobalLog.Log("COMMAND" + command);
|
||||
|
||||
for(int i = 0; i < args.length; ++i)
|
||||
statement.setString(i + 1, args[i]);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package network;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
public enum JDBCStatementType
|
||||
{
|
||||
Insert (0), Update(1), Select(2);
|
||||
|
||||
private final int value;
|
||||
private JDBCStatementType(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public static Optional<JDBCStatementType> valueOf(int value)
|
||||
{
|
||||
return Arrays.stream(values()).filter(role -> role.value == value).findFirst();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user