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 141488

Summary: java.sql.SQLException: Syntax error: Encountered "." at line 1, column 81.
Product: db Reporter: John Baker <jbaker>
Component: Show DataAssignee: _ ahimanikya <ahimanikya>
Status: VERIFIED FIXED    
Severity: blocker CC: jbaker, romanmostyka
Priority: P2    
Version: 6.x   
Hardware: Macintosh   
OS: All   
URL: http://statistics.netbeans.org/exceptions/detail.do?id=81247
Issue Type: DEFECT Exception Reporter: 81247
Attachments: SQL script to execute

Description John Baker 2008-07-24 08:54:20 UTC
Build: NetBeans IDE Dev (Build 080721)
VM: Java HotSpot(TM) Client VM, 1.5.0_13-121, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-241
OS: Mac OS X, 10.4.11, i386
User comments: 
I was executing a script to recreate tables for Derby.  I will attach this sql script

The SQL script I executed is located in the installation directory of NetBeans in the visualweb2/startup/samples folder.
 The filename is create-Travel-derby.sql
STACKTRACE: (first 10 lines)
java.sql.SQLException: Syntax error: Encountered "." at line 1, column 81.
        at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:0)
        at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:0)
        at org.apache.derby.client.am.Statement.execute(Statement.java:0)
        at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.executeSQLStatement(SQLExecutionHelper.java:549)
        at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:97)
        at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:104)
        at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:71)
        at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:112)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$SQLExecutor.run(SQLEditorSupport.java:482)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
Comment 1 John Baker 2008-07-24 08:55:50 UTC
Created attachment 65495 [details]
SQL script to execute
Comment 2 John Baker 2008-07-24 08:57:04 UTC
Basically, I opened the attached SQL file, set the connection to Travel and execute.

Travel is a sample database included in the NetBeans visualweb cluster
Comment 3 _ ahimanikya 2008-07-24 09:30:14 UTC
Since we run each statement in background thread, this is happening since the required object does not exist when we are
trying to execute 

create view travel.PersonTrip as select tripid, name from trip, person where trip.personid = person.personid ;

When I tried executing separately it worked fine. So may be we need to execute the statements sequentially when,
assigning this to David. 
Comment 4 Andrei Badea 2008-07-24 10:47:58 UTC
I don't think the cause of the error is the background thread. The statement are executed sequentially in that thread.
Moreover, the error is a syntax error. Had the view not existed, the message would have said so.

Since David is not here, could you please have another look at it?
Comment 5 _ ahimanikya 2008-07-24 12:10:59 UTC
http://hg.netbeans.org/main/rev/7053956322ae
Comment 6 Roman Mostyka 2008-07-24 17:28:29 UTC
Verified with build 080724.