You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Devang kamdar <de...@gmail.com> on 2008/05/01 12:17:14 UTC

Cannot Use DROP in ALTER Table in NetBeans 6.0.1 (Derby Integrated)

Hi,

I am trying to get started with Derby and Netbeans
I am not able to use the DROP command.

Getting following error in NetBeans (Derby Integrated)
Error code -1, SQL state 42X01: Syntax error: Encountered "DROP" at line 2,
column 1.
Line 1, column 1

Here is the SQL statement:
ALTER TABLE TRAN
DROP COLUMN TRAN_DESC

Also, is there a way to rename a column?
Right now I am trying to DROP it and ADD it again.
I am just creating the DB, so there is no data at present and this seems
reasonable work-around.
But what if my DB is populated? If I Drop the column, I will loose all the
data?
Is there a viable alternative?

Please let me know.

Thanks
Dev.

Re: Cannot Use DROP in ALTER Table in NetBeans 6.0.1 (Derby Integrated)

Posted by "John H. Embretsen" <Jo...@Sun.COM>.
Some additional info regarding versions and Netbeans:

- The fact that NetBeans has been *tested with* a particular version of
Derby (or Java DB) does not mean that NetBeans *bundles* that version.

- NetBeans (6.0) itself does not bundle Java DB or Derby. However,
Glassfish and JDK 6 bundles Java DB, so your copy of the database
software may stem from either of these sources (which may come bundled
with NetBeans...).

- In addition to the method described by Rick, additional ways of
finding out which version of Derby or Java DB you are running may be
found here: http://wiki.apache.org/db-derby/VersionInfo. The "driver and
server version (CLASSPATH)" section should be particularly suitable for
NetBeans users.

- If you need to upgrade your Derby / Java DB libraries, this can be
easily done in NetBeans context. You just have to point NetBeans to your
Derby / Java DB installation (unless you replace the installation
already installed). See http://www.netbeans.org/kb/60/ide/java-db.html
for some details.

Hope this helps,

-- 
John

Rick Hillegas wrote:
> Hi Dev,
> 
> Your question seems to center on Netbeans configuration. You may get 
> better, faster answers if you pose these configuration questions to the 
> Netbeans lists. However, here is a crude way to figure out what version 
> of Derby you are using:
> 
> Inside Netbeans, click through these menus:
> 
>   Tools -> Java DB Database -> Settings
> 
> This will pop up a window which describes your Derby configuration. In 
> particular, the "Java DB Installation" line will tell you where Netbeans 
> is looking for Derby software. Let's say that line tells you that Derby 
> is located at "/foo/bar/wibble". In a shell window, type the following 
> command:
> 
> java -jar /foo/bar/wibble/lib/derbyrun.jar sysinfo
> 
> This will print out information on the version of Derby which lives in 
> that installation.
> 
> Hope this helps,
> -Rick
> 
> Devang kamdar wrote:
>> Thanks for the response Rick.
>>
>> I am not able to verify from the IDE.
>> However, I checked the release notes online for NetBeans and it says, 
>> under tested drivers
>> *Tested Drivers*
>>
>> NetBeans IDE 6.0 has been tested with the following databases and 
>> drivers.
>>
>> Driver
>>     
>> Version
>>     
>> Example URL
>> JavaDB     Derby 10.3.1.4 <http://10.3.1.4> 
>> |jdbc:derby://localhost:1527/sample| (Network)
>> Oracle     Oracle Database 10g Release 2 (10.2.0.3 <http://10.2.0.3>) 
>> |jdbc:oracle:thin:@//localhost:1521:ora9i|
>> PostgreSQL     8.2 Build 506 
>> |jdbc:postgresql://jbrave-pc1.sfbay.sun.com:5432/postgres 
>> <http://jbrave-pc1.sfbay.sun.com:5432/postgres>|
>> MySQL     MySQL Connector/J 5.0.7
>>
>> Here is the link to NB Release notes:
>> http://www.netbeans.org/community/releases/60/relnotes.html#sql-db
>>
>> Does this mean, its running 10.3.1.4 <http://10.3.1.4> version of 
>> Derby(Java DB)?
>>
>> If I am not interpreting it correctly, is there a concrete way of 
>> checking, which version of Derby am I running?
>>
>> Also, if I am running an older version that is not supporting the DROP 
>> command, is there a way, I can integrate the newer version of JAVA-DB 
>> in NB?
>> Cos NB is giving me a very easy and nice interface to work with Java 
>> DB and makes creating and populating tables much faster.
>> OR
>> as an alternative, are there any GUIs available to work with bare 
>> JAVA-DB database like toad?
>>
>> Please let me know your suggestions.
>>
>> Thanks
>> Dev.
>>
>> On Thu, May 1, 2008 at 6:38 PM, Rick Hillegas 
>> <Richard.Hillegas@sun.com <ma...@sun.com>> wrote:
>>
>>     Hi Dev,
>>
>>     Do you know what version of Derby you are using with Netbeans?
>>     Column dropping and renaming were added to Derby in release
>>     10.3.1.4 <http://10.3.1.4>.
>>
>>     Hope this helps,
>>     -Rick
>>
>>
>>     Devang kamdar wrote:
>>
>>         Hi,
>>
>>         I am trying to get started with Derby and Netbeans
>>         I am not able to use the DROP command.
>>
>>         Getting following error in NetBeans (Derby Integrated)
>>         Error code -1, SQL state 42X01: Syntax error: Encountered
>>         "DROP" at line 2, column 1.
>>         Line 1, column 1
>>
>>         Here is the SQL statement:
>>         ALTER TABLE TRAN
>>         DROP COLUMN TRAN_DESC
>>
>>         Also, is there a way to rename a column?
>>         Right now I am trying to DROP it and ADD it again.
>>         I am just creating the DB, so there is no data at present and
>>         this seems reasonable work-around.
>>         But what if my DB is populated? If I Drop the column, I will
>>         loose all the data?
>>         Is there a viable alternative?
>>
>>         Please let me know.
>>
>>         Thanks
>>         Dev.
>>
>>
>>
> 




Re: Cannot Use DROP in ALTER Table in NetBeans 6.0.1 (Derby Integrated)

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Dev,

Your question seems to center on Netbeans configuration. You may get 
better, faster answers if you pose these configuration questions to the 
Netbeans lists. However, here is a crude way to figure out what version 
of Derby you are using:

Inside Netbeans, click through these menus:

   Tools -> Java DB Database -> Settings

This will pop up a window which describes your Derby configuration. In 
particular, the "Java DB Installation" line will tell you where Netbeans 
is looking for Derby software. Let's say that line tells you that Derby 
is located at "/foo/bar/wibble". In a shell window, type the following 
command:

java -jar /foo/bar/wibble/lib/derbyrun.jar sysinfo

This will print out information on the version of Derby which lives in 
that installation.

Hope this helps,
-Rick

Devang kamdar wrote:
> Thanks for the response Rick.
>
> I am not able to verify from the IDE.
> However, I checked the release notes online for NetBeans and it says, 
> under tested drivers
> *Tested Drivers*
>
> NetBeans IDE 6.0 has been tested with the following databases and drivers.
>
> Driver
> 	
> Version
> 	
> Example URL
> JavaDB 	Derby 10.3.1.4 <http://10.3.1.4> 
> |jdbc:derby://localhost:1527/sample| (Network)
> Oracle 	Oracle Database 10g Release 2 (10.2.0.3 <http://10.2.0.3>) 
> |jdbc:oracle:thin:@//localhost:1521:ora9i|
> PostgreSQL 	8.2 Build 506 
> |jdbc:postgresql://jbrave-pc1.sfbay.sun.com:5432/postgres 
> <http://jbrave-pc1.sfbay.sun.com:5432/postgres>|
> MySQL 	MySQL Connector/J 5.0.7
>
> Here is the link to NB Release notes:
> http://www.netbeans.org/community/releases/60/relnotes.html#sql-db
>
> Does this mean, its running 10.3.1.4 <http://10.3.1.4> version of 
> Derby(Java DB)?
>
> If I am not interpreting it correctly, is there a concrete way of 
> checking, which version of Derby am I running?
>
> Also, if I am running an older version that is not supporting the DROP 
> command, is there a way, I can integrate the newer version of JAVA-DB 
> in NB?
> Cos NB is giving me a very easy and nice interface to work with Java 
> DB and makes creating and populating tables much faster.
> OR
> as an alternative, are there any GUIs available to work with bare 
> JAVA-DB database like toad?
>
> Please let me know your suggestions.
>
> Thanks
> Dev.
>
> On Thu, May 1, 2008 at 6:38 PM, Rick Hillegas 
> <Richard.Hillegas@sun.com <ma...@sun.com>> wrote:
>
>     Hi Dev,
>
>     Do you know what version of Derby you are using with Netbeans?
>     Column dropping and renaming were added to Derby in release
>     10.3.1.4 <http://10.3.1.4>.
>
>     Hope this helps,
>     -Rick
>
>
>     Devang kamdar wrote:
>
>         Hi,
>
>         I am trying to get started with Derby and Netbeans
>         I am not able to use the DROP command.
>
>         Getting following error in NetBeans (Derby Integrated)
>         Error code -1, SQL state 42X01: Syntax error: Encountered
>         "DROP" at line 2, column 1.
>         Line 1, column 1
>
>         Here is the SQL statement:
>         ALTER TABLE TRAN
>         DROP COLUMN TRAN_DESC
>
>         Also, is there a way to rename a column?
>         Right now I am trying to DROP it and ADD it again.
>         I am just creating the DB, so there is no data at present and
>         this seems reasonable work-around.
>         But what if my DB is populated? If I Drop the column, I will
>         loose all the data?
>         Is there a viable alternative?
>
>         Please let me know.
>
>         Thanks
>         Dev.
>
>
>


Re: Cannot Use DROP in ALTER Table in NetBeans 6.0.1 (Derby Integrated)

Posted by Devang kamdar <de...@gmail.com>.
Thanks for the response Rick.

I am not able to verify from the IDE.
However, I checked the release notes online for NetBeans and it says, under
tested drivers
*Tested Drivers*

NetBeans IDE 6.0 has been tested with the following databases and drivers.
  Driver
 Version
 Example URL
 JavaDB Derby 10.3.1.4 jdbc:derby://localhost:1527/sample (Network)
Oracle Oracle
Database 10g Release 2 (10.2.0.3) jdbc:oracle:thin:@//localhost:1521:ora9i
PostgreSQL 8.2 Build 506 jdbc:postgresql://
jbrave-pc1.sfbay.sun.com:5432/postgres MySQL MySQL Connector/J 5.0.7Here is
the link to NB Release notes:
http://www.netbeans.org/community/releases/60/relnotes.html#sql-db

Does this mean, its running 10.3.1.4 version of Derby(Java DB)?

If I am not interpreting it correctly, is there a concrete way of checking,
which version of Derby am I running?

Also, if I am running an older version that is not supporting the DROP
command, is there a way, I can integrate the newer version of JAVA-DB in NB?

Cos NB is giving me a very easy and nice interface to work with Java DB and
makes creating and populating tables much faster.
OR
as an alternative, are there any GUIs available to work with bare JAVA-DB
database like toad?

Please let me know your suggestions.

Thanks
Dev.

On Thu, May 1, 2008 at 6:38 PM, Rick Hillegas <Ri...@sun.com>
wrote:

> Hi Dev,
>
> Do you know what version of Derby you are using with Netbeans? Column
> dropping and renaming were added to Derby in release 10.3.1.4.
>
> Hope this helps,
> -Rick
>
>
> Devang kamdar wrote:
>
>> Hi,
>>
>> I am trying to get started with Derby and Netbeans
>> I am not able to use the DROP command.
>>
>> Getting following error in NetBeans (Derby Integrated)
>> Error code -1, SQL state 42X01: Syntax error: Encountered "DROP" at line
>> 2, column 1.
>> Line 1, column 1
>>
>> Here is the SQL statement:
>> ALTER TABLE TRAN
>> DROP COLUMN TRAN_DESC
>>
>> Also, is there a way to rename a column?
>> Right now I am trying to DROP it and ADD it again.
>> I am just creating the DB, so there is no data at present and this seems
>> reasonable work-around.
>> But what if my DB is populated? If I Drop the column, I will loose all the
>> data?
>> Is there a viable alternative?
>>
>> Please let me know.
>>
>> Thanks
>> Dev.
>>
>
>

Re: Cannot Use DROP in ALTER Table in NetBeans 6.0.1 (Derby Integrated)

Posted by Rick Hillegas <Ri...@Sun.COM>.
Hi Dev,

Do you know what version of Derby you are using with Netbeans? Column 
dropping and renaming were added to Derby in release 10.3.1.4.

Hope this helps,
-Rick

Devang kamdar wrote:
> Hi,
>
> I am trying to get started with Derby and Netbeans
> I am not able to use the DROP command.
>
> Getting following error in NetBeans (Derby Integrated)
> Error code -1, SQL state 42X01: Syntax error: Encountered "DROP" at 
> line 2, column 1.
> Line 1, column 1
>
> Here is the SQL statement:
> ALTER TABLE TRAN
> DROP COLUMN TRAN_DESC
>
> Also, is there a way to rename a column?
> Right now I am trying to DROP it and ADD it again.
> I am just creating the DB, so there is no data at present and this 
> seems reasonable work-around.
> But what if my DB is populated? If I Drop the column, I will loose all 
> the data?
> Is there a viable alternative?
>
> Please let me know.
>
> Thanks
> Dev.