This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155140 - Inserting Record to Java DB returns Syntax error encountered "PUBLIC"
Summary: Inserting Record to Java DB returns Syntax error encountered "PUBLIC"
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P3 blocker (vote)
Assignee: _ ahimanikya
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-10 14:28 UTC by deejross
Modified: 2009-02-19 20:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description deejross 2008-12-10 14:28:46 UTC
Tried inserting a record into a Java DB database after installing NetBeans and I get this error after entering the new
record information and clicking OK: Inserting Record to Java DB returns Syntax error encountered "PUBLIC" at line 1,
column 13.

Clicking the Show SQL button before clicking OK in the Insert Record window produces the following SQL code:
INSERT INTO PUBLIC.CUSTOMER
	 (SSN, CUST_NAME, ADDRESS) 
VALUES 
	('123-45-6789', 'Bob Smith', '1234 Nowhere Ln, BFE')

Database and tables were created from the StockMarket.sql file while following Java SE Application Development-2851-SE6
class. This is the contents of the SQL file:

CREATE TABLE Customer (
	ssn CHAR(15) NOT NULL,
	cust_name CHAR(40),
	address CHAR(100)
);

CREATE UNIQUE INDEX idx1 ON Customer (ssn);

CREATE TABLE Shares (
	ssn CHAR(15) NOT NULL,
	symbol CHAR(8) NOT NULL,
	quantity INT
);

CREATE TABLE Stock (
	symbol CHAR(15) NOT NULL,
	price real
);


System Information:

Mac Pro (dual-core Intel Xeon)
Mac OS X 10.5.5
4GB RAM
Installed NetBeans from website using the Java pack (SE, Web/EE, GlassFish V2 & V3)
Comment 1 _ ahimanikya 2008-12-10 15:23:38 UTC
This looks like an Quoter issue.

Only when you create a database called "PUBLIC" this fails, since PUBLIC is a key word and need to be quoted.

if you right click on the table and select View Data it will generated SELECT * from PUBLIC.Customer, which also fails,
for the same reason. It will be nice if we can fix this quoter, since Data View also uses quoter to determine whether to
quote or not. 

For now I will use quote always to fix this issue.
Comment 2 _ ahimanikya 2008-12-10 21:26:22 UTC
http://hg.netbeans.org/main/rev/07607a90caa1
Comment 3 David Vancouvering 2008-12-10 21:33:49 UTC
The Quoter issue has to do with quoting keywords.  See Issue 121018.  On our list for 7.0...
Comment 4 Roman Mostyka 2008-12-11 07:56:29 UTC
deejross, can You verify please with latest build that this issue was really fixed?
Comment 5 Quality Engineering 2008-12-11 16:56:58 UTC
Integrated into 'main-golden', will be available in build *200812111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/07607a90caa1
User: ahimanikya@netbeans.org
Log: Issue #155140 Inserting Record to Java DB returns Syntax error encountered "PUBLIC"