|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.jdbw.util.NullValue
public class NullValue
This class is a null value representation when dealing with SQL parameters.
The reason why this is needed is that some database servers requires you to
supply what 'type' of null (as in, is it a varchar null, an int
null or something else) you are giving. Trying to assign null of a wrong type
will give you an SQLException.
Since the Java null keyword has no type information, when you supply
it to a JDBW class database method (for example, SQLWorker.query(...)
or SQLExecutor.execute(...)) in the parameter list, type
varchar will be associated with this null. If this is incompatible
with your database server/table/column, you can instead of null pass in an
instance of one of the subclasses of this class. There isn't a subclass for
every conceivable datatype, but there should be one that is compatible with
what you need.
| Nested Class Summary | |
|---|---|
static class |
NullValue.Binary
Represents a null binary value. |
static class |
NullValue.Decimal
Represents a null decimal value. |
static class |
NullValue.Double
Represents a null double value. |
static class |
NullValue.Integer
Represents a null integer value. |
static class |
NullValue.String
Represents a null varchar value. |
static class |
NullValue.Timestamp
Represents a null timestamp value. |
| Method Summary | |
|---|---|
static Object |
fromSqlType(int sqlType)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Object fromSqlType(int sqlType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||