java - Hesitation about blank fields in access database -


i'm trying values db in *.accdb format microsoft access. i'm writing java programa using proper jdbc driver gets values access database.

the query this:

select * table_name 

i able retrieve values need , have no problem that. issue comes when see (apparently, i'm quite sure are) empty fields on file, retrieved "null" or "" (empty strings) text datatype columns when convert results strings in java.

i analyzed database looking default value of each column etc.. found no logical reason retrieving null or "" empty cell. according office support page:

when field contains no values, contains null value or, for text, memo, or hyperlink fields, null value or zero-length string.

then see empty fields can returned in both types still can't understand the criteria.

i found out in mssql databases depends on how value entered.

if have table (asuming als cols string):

tbl1 ---------------------- | col1 | col2 | col3 | ---------------------- 

now insert data in this:

insert tbl1 (col1) values ('test') 

you get:

col1: test col2: null col3: null 

but if yoy insert data (e.g. don't check if value "" in col2)

insert tbl1 (col1, col2, col3) values ('test', '', '') 

you get:

col1: test col2: "" col3: "" 

this happens not inserting data filled user instead of whole data.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -