E
espresso
I have a mysql table with two columns, DeptNo and DeptName. I am
making inserts from java code with the following where the variables
are populated with text from a jTextfield:
sqlString = "INSERT INTO department SET DeptNo= '" + deptno + "' + ','
+ 'DeptName=' + '" + deptname + "'";
int result=0;
result= dbc.executeUpdate(sqlString);
Each time I do this insert I get a result of one--successfull
insert--but only the deptno value gets inserted into the database. The
DeptName field is blank.
I have also tried this with a prepared statement to test if there is
something wrong with my sqlString, but I get the same result.
Any ideas what is happening here.
Thanks
making inserts from java code with the following where the variables
are populated with text from a jTextfield:
sqlString = "INSERT INTO department SET DeptNo= '" + deptno + "' + ','
+ 'DeptName=' + '" + deptname + "'";
int result=0;
result= dbc.executeUpdate(sqlString);
Each time I do this insert I get a result of one--successfull
insert--but only the deptno value gets inserted into the database. The
DeptName field is blank.
I have also tried this with a prepared statement to test if there is
something wrong with my sqlString, but I get the same result.
Any ideas what is happening here.
Thanks