3

I'm running throught NetBeans E-commerce tutorial and I got stuck on following problem.

Here is the tutorial part. I'm concretely on step Adding Sample Data to the Database . When I execute this trivial command : select * from category; I obtain error

Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT' at line 1
Line 1, column 1

No values of this select are displayed, despite the fact that the table is not empty set.

I'm executing this command in NetBeans IDE 7.3 RC2 inside the Database Explorer Module using Execute Command option.

I was thinking if the problem could not be in the encoding that I use in my database. I used utf8 - utf8_unicode_ci then i changed it into utf8 default collation, but there is no change.

I use MySQL 5.6.10 and managing it via MySQL Workbench.

Thank you very much for your answers :)

EDIT and PARTIAL SOLUTION: To finish my answer and answer it partially. I don't know why the SQL script editor in netbeans does not work. But finally I successfully created the connection pool and datasource. All queries made via datasource in JSP pages work fine.

4
  • The error message does not match the statement you claim to be running. Commented Feb 19, 2013 at 18:07
  • Is it possible that netbeans sends additional parameters before the query? Anyways, use something else than netbeans for database queries. I would recommend the mysql command line client. Commented Feb 19, 2013 at 18:09
  • queries work fine from standard MySQL command line. The problem is I would like to use ConnectionPool and DataSource in Java EE under netbeans to generate JPA entities. But I'm also unable to create this pool. I've tested standard Java DB Derby and commands there work fine :) Commented Feb 19, 2013 at 18:16
  • well I've fixed the connection pool but still not sure why the NetBeans sql editor does not work :) probably as a_horse_with_no_name said, netbeans adds some code into sql and so it does not work. But it's weird because I remember I used this editor some time ago...hm Commented Feb 19, 2013 at 18:30

3 Answers 3

3

Looks like the netbeans connector was using a deprecated command that got removed in MySQL 5.6. Found this discussion, they seem to have found an answer:

http://netbeans.org/bugzilla/show_bug.cgi?id=224260

Sign up to request clarification or add additional context in comments.

2 Comments

thanks for answer :) so because of this fact older netbeans with older mysql worked ! :)
@Reshi - Well, really any netbeans with older mysql. It's the fact that MySQL changed what syntax it allows code to use that caused the problem. MySQL has been warning people for years that they were going to remove this, but the netbeans dev team never updated their connector, likely on the "if it aint broke, don't fix it philosophy. It finally broke when MySQL made good on removing that functionality.
3

This is a bug of the mysql driver. In netbeans change the jar of your mysql driver with the lastest version. For example with mysql-connector-java-5.1.24 the "View Data" command in NetBeans works fine.

Comments

0

netbeans evaluates the field in different way in mysql cmd if you would type this syntax say insert into user ('username', 'password') values ('xyz', 'abc'); it would work perfectly fine but in netbeans the tables and field names are indicated not in single quotes but in `` this type of quotes so this would perfectly fine in netbeans insert into user (username, password) values ('xyz', 'abc'); where string like xyz and abc are expressed in single quotes...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.