A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Java DB Error
Joined: Jan 08, 2010
Jan 24, 2010 09:41:24
CREATE TABLE `insurance` ( `ID` int(11) NOT NULL default '0', `insurance_name` varchar(50) default NULL, `invested_amount` int(11) default NULL, `investement_date` datetime default NULL, PRIMARY KEY (`ID`) ) TYPE=MyISAM;
when i am going to run this aode in Netbeans SQL Command is says
Error code -1, SQL state 42X02: Lexical error at line 1, column 14. Encountered: "`" (96), after : "". Line 1, column 1 Execution finished after 0 s, 1 error(s) occurred.
Joined: Mar 22, 2005
Jan 24, 2010 10:17:25
What makes you think that the backtick ("`") is a legal character in SQL?
Ping & DNS, my free Android app for network diagnostics
Joined: Feb 24, 2006
Jan 24, 2010 10:26:14
They must have been introduced when you copied it from a word document or something. Correct the illegal characters to continue and create the table.
Also pay attention to the error message line number and column. It pretty much told you where the offending character was
SCJP 6 articles
SCJP 5/6 mock exams
More SCJP Mocks
subject: Java DB Error
create table auto_increment
Three problems with mysql...
SQL query not giving any result
JavaDb creating table error
how set "default" inthe name of column ?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013