java - NULL values loading file into mysql table -


i have file contains list of words , trying load them mysql table. null values.

this how words saved files

silver

gold

modern

paper

current

and on

this related part of code

string sqlkeywordcreate=new string ("create table keywordstable " + " (k_id integer       not null auto_increment primary key,  keywords varchar(25))"); stmt1.executeupdate(sqlkeywordcreate);  string sqlloadkey ="load data local infile "      +"'e:/thesis/thesiswork/outdata/keywords.txt'"+ " \n" +   "   table "+ "keywordstable"+"lines terminated '\r\n'";; stmt1.executeupdate(sqlloadkey); 

this how table outputted

k_id | keywords  1    |  null  2    |  null 

and on.

i not know wrong here specially have data no missing ones. me please

your load command essentially:

load data     infile 'e:/thesis/thesiswork/outdata/keywords.txt'     table keywordstable; 

your table has 2 columns. so, try put string value first column.

to want, try this:

load data     local infile 'e:/thesis/thesiswork/outdata/keywords.txt'     table keywordstable     (keywords); 

Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -