File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
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?
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
I agree. Here's the link:
subject: Java DB Error
create table auto_increment
JavaDb creating table error
SQL query not giving any result
Three problems with mysql...
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-2015