|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hardcode.gdbms.driver.foodriver.FooDriver
public class FooDriver
Field Summary |
---|
Fields inherited from interface com.hardcode.gdbms.engine.values.ValueWriter |
---|
internalValueWriter |
Constructor Summary | |
---|---|
FooDriver()
|
Method Summary | |
---|---|
java.lang.String |
check(Field field,
Value value)
Checks if a given value is suitable for the specified field |
void |
close()
Free any resource reserved in the open method |
void |
createSource(DBSource source,
DriverMetadata driverMetadata)
Creates a new table. |
void |
execute(java.sql.Connection con,
java.lang.String sql)
Executes an instruction against the server |
java.lang.String[] |
getAvailableTypes()
Gets a string identificator for each type a field can have |
java.lang.String[] |
getAvailableTypes(java.lang.String host,
int port,
java.lang.String dbName,
java.lang.String user,
java.lang.String password)
|
java.sql.Connection |
getConnection(java.lang.String host,
int port,
java.lang.String dbName,
java.lang.String user,
java.lang.String password)
Método mediante el cual el driver surte de conexiones a la base de datos. |
DriverMetadata |
getDriverMetadata()
Gets the driver specific metadata |
java.util.HashMap |
getDriverProperties()
|
int |
getFieldCount()
|
java.lang.String |
getFieldName(int fieldId)
|
int |
getFieldType(int i)
|
Value |
getFieldValue(long rowIndex,
int fieldId)
Obtiene el valor que se encuentra en la fila y columna indicada |
java.lang.String |
getInternalTableName(java.lang.String tablename)
|
java.sql.ResultSetMetaData |
getMetadata()
|
java.lang.String |
getName()
|
java.lang.String |
getNullStatementString()
Gets the string of the binary param as it would appear in a SQL statement |
java.lang.String[] |
getParameters(java.lang.String driverType)
Gets the parameters used in creating the type |
java.lang.String[] |
getParameters(java.lang.String host,
int port,
java.lang.String dbName,
java.lang.String user,
java.lang.String password,
java.lang.String driverType)
|
long |
getRowCount()
Obtiene el número de registros del DataSource |
java.lang.String |
getStatementString(boolean b)
Gets the string of the binary param as it would appear in a SQL statement |
java.lang.String |
getStatementString(byte[] binary)
Gets the string of the binary param as it would appear in a SQL statement |
java.lang.String |
getStatementString(java.sql.Date d)
Gets the string of the param as it would appear in a SQL statement |
java.lang.String |
getStatementString(double d,
int sqlType)
Gets the string of the d param as it would appear in a SQL statement |
java.lang.String |
getStatementString(Geometry g)
Gets the string representation of the geometry as it would appear in a SQL statement |
java.lang.String |
getStatementString(int i,
int sqlType)
Gets the string of the i param as it would appear in a SQL statement |
java.lang.String |
getStatementString(long i)
Gets the string of the i param as it would appear in a SQL statement |
java.lang.String |
getStatementString(java.lang.String str,
int sqlType)
Gets the string of the str param as it would appear in a SQL statement |
java.lang.String |
getStatementString(java.sql.Time t)
Gets the string of the param as it would appear in a SQL statement |
java.lang.String |
getStatementString(java.sql.Timestamp ts)
Gets the string of the param as it would appear in a SQL statement |
int |
getType(java.lang.String driverType)
Gets the suitable GDBMS type for the given driver specific type |
java.lang.String |
getTypeInAddColumnStatement(java.lang.String driverType,
java.util.HashMap<java.lang.String,java.lang.String> params)
Gets a statement to create the specified field on the given table |
boolean |
isReadOnly(int i)
Returns true if the specified field is read only |
boolean |
isValidParameter(java.lang.String driverType,
java.lang.String paramName,
java.lang.String paramValue)
Returns if the given value (paramValue) for the parameter called paramName of the given driver specific type is valid or not |
void |
open(java.sql.Connection con,
java.lang.String tableName,
java.lang.String orderFieldName)
Connects to the data source and reads the specified table in the specified order |
void |
setDataSourceFactory(DataSourceFactory dsf)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FooDriver()
Method Detail |
---|
public java.sql.Connection getConnection(java.lang.String host, int port, java.lang.String dbName, java.lang.String user, java.lang.String password) throws java.sql.SQLException
DBDriver
getConnection
in interface DBDriver
host
- nombre o dirección IP del host al que se quiere conectarport
- puerto al que se quiere conectar. -1 si es el puerto por
defectodbName
- Nombre de la base de datos a la que se quiere conectaruser
- Usuario de la conexiónpassword
- Password del usuario
java.sql.SQLException
- Si se produce algún errorpublic void open(java.sql.Connection con, java.lang.String tableName, java.lang.String orderFieldName) throws DriverException
AlphanumericDBDriver
open
in interface AlphanumericDBDriver
con
- Connection to usetableName
- Name of the table where the data is inorderFieldName
- Name of the order field. Can be null
DriverException
public void execute(java.sql.Connection con, java.lang.String sql) throws java.sql.SQLException
DBDriver
execute
in interface DBDriver
con
- Connection used to execute the instructionsql
- Instruction to execute
java.sql.SQLException
- If the execution failspublic void close() throws DriverException
DBDriver
close
in interface DBDriver
DriverException
public java.lang.String getInternalTableName(java.lang.String tablename)
public Value getFieldValue(long rowIndex, int fieldId) throws DriverException
ReadAccess
getFieldValue
in interface ReadAccess
rowIndex
- filafieldId
- columna
DriverException
- Si se produce un error accediendo al DataSourcepublic int getFieldCount() throws DriverException
DriverException
public java.lang.String getFieldName(int fieldId) throws DriverException
DriverException
public long getRowCount() throws DriverException
ReadAccess
getRowCount
in interface ReadAccess
DriverException
- Si se produce algún error accediendo al
DataSourcepublic int getFieldType(int i) throws DriverException
DriverException
public java.lang.String getName()
getName
in interface com.hardcode.driverManager.Driver
public java.lang.String getStatementString(long i)
ValueWriter
getStatementString
in interface ValueWriter
i
- long to format
public java.lang.String getStatementString(int i, int sqlType)
ValueWriter
getStatementString
in interface ValueWriter
i
- integer to formatsqlType
- SQL type of the parameter. Any of the following
java.sql.Types constants: INTEGER, SMALLINT, TINYINT
public java.lang.String getStatementString(double d, int sqlType)
ValueWriter
getStatementString
in interface ValueWriter
d
- double to formatsqlType
- SQL type of the parameter. Any of the following
java.sql.Types constants: DOUBLE, FLOAT, REAL, NUMERIC, DECIMAL
public java.lang.String getStatementString(java.lang.String str, int sqlType)
ValueWriter
getStatementString
in interface ValueWriter
str
- string to formatsqlType
- SQL type of the parameter. Any of the following
java.sql.Types constants: CHAR, VARCHAR, LONGVARCHAR
public java.lang.String getStatementString(java.sql.Date d)
ValueWriter
getStatementString
in interface ValueWriter
d
- Date to format
public java.lang.String getStatementString(java.sql.Time t)
ValueWriter
getStatementString
in interface ValueWriter
t
- Time to format
public java.lang.String getStatementString(java.sql.Timestamp ts)
ValueWriter
getStatementString
in interface ValueWriter
ts
- timestamp to format
public java.lang.String getStatementString(byte[] binary)
ValueWriter
getStatementString
in interface ValueWriter
binary
- byte array to format
public java.lang.String getStatementString(boolean b)
ValueWriter
getStatementString
in interface ValueWriter
b
- byte array to format
public java.lang.String getNullStatementString()
ValueWriter
getNullStatementString
in interface ValueWriter
public java.util.HashMap getDriverProperties()
public void setDataSourceFactory(DataSourceFactory dsf)
setDataSourceFactory
in interface GDBMSDriver
public java.sql.ResultSetMetaData getMetadata() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getStatementString(Geometry g)
ValueWriter
getStatementString
in interface ValueWriter
g
- Geometry
public DriverMetadata getDriverMetadata() throws DriverException
GDBMSDriver
getDriverMetadata
in interface GDBMSDriver
DriverException
public int getType(java.lang.String driverType)
TypeConverter
getType
in interface TypeConverter
public java.lang.String getTypeInAddColumnStatement(java.lang.String driverType, java.util.HashMap<java.lang.String,java.lang.String> params)
DBDriver
getTypeInAddColumnStatement
in interface DBDriver
public java.lang.String[] getAvailableTypes() throws DriverException
GDBMSDriver
getAvailableTypes
in interface GDBMSDriver
DriverException
public java.lang.String[] getParameters(java.lang.String driverType) throws DriverException
GDBMSDriver
getParameters
in interface GDBMSDriver
DriverException
public void createSource(DBSource source, DriverMetadata driverMetadata) throws DriverException
AlphanumericDBDriver
createSource
in interface AlphanumericDBDriver
DriverException
- TODOpublic java.lang.String[] getAvailableTypes(java.lang.String host, int port, java.lang.String dbName, java.lang.String user, java.lang.String password) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String[] getParameters(java.lang.String host, int port, java.lang.String dbName, java.lang.String user, java.lang.String password, java.lang.String driverType) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String check(Field field, Value value) throws DriverException
GDBMSDriver
check
in interface GDBMSDriver
DriverException
public boolean isReadOnly(int i)
GDBMSDriver
isReadOnly
in interface GDBMSDriver
public boolean isValidParameter(java.lang.String driverType, java.lang.String paramName, java.lang.String paramValue)
GDBMSDriver
isValidParameter
in interface GDBMSDriver
paramValue
- null if the parameter is not specified
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |