How To Rename Colums in Derby DB and NetBeans 6 Beta 2

Yesterday, I showed you how to create foreign keys in Derby DB within NetBeans 6 Beta 2 database tools. After I thought I had finished this tutorial I noticed a little mistake in my ‚PRUEFEN‘ table of my database.

The primary key or better the foreign key ‚PERNR‘ had the wrong name. The right name should have been ‚PERSNR‘ which is a reference to the primary key ‚PERSNR‘ of my ‚PROFESSOREN‘ table. So, how can I refactore this little (I thought it was little but it wasn’t) mistake.

The first step I have done was to search for a solution in the Derby documentation and it’s SQL implementation and feature support. Today I’ve finally realised that something like ‚ALTER TABLE RENAME COLUMN OLDNAME TO NEWNAME‘ isn’t supported by Derby so I tried to figure out an alternative way to find a solution for my problem. Here’s what I did:

I’ve created a backup of my table and with this backup I’m able to recreate my table again. The idea was to delete the old ‚PRUEFEN‘ table and create a new one by recreating the old table.

This will open a dialog with a SQL command which will set up my new table (=> simple CREATE TABLE statement). So, the advantage of this workaround is, I just have to rename my column in the SQL-statement and I would have found a solution for my problem… BUT… (keep on reading ;o)

First of all you’ll be able to backup your table by right clicking it and execute the ‚Grab Structure…‘ command. A save-dialog will pop up and there you can choose a place to save your table structure.

No you will be able to grab this structure of your old table and recreate a new one by right clicking the Table folder und select the ‚Recreate Table…‘ button. Of course you have to rename your table if you haven’t deleted the old ‚PRUEFEN‘ table to something like ‚PRUFENNEW‘.

This will open up a new diaolog with the CREATE TABLE statement. Now by clicking the ‚Edit table script‘ button you will be able to change your column name. If you have already forgotten… that’s why I’ve started to write this tutorial 😉

Have you recognized the table script in the above picture? Where have all the foreign keys gone? Hmmmmmm…. So now I have the same work as yesterday. Hopefully in the final release this problem will be solved. I changed my table script so all my requirements are implemented and that is what it looks like:

Finished! No…. I’ve forgotton the PERSNR foreign key. Damn it! But I have to do the whole work again anyway because I don’t want to have the ‚…NEW‘ in my table’s name. Ahhhh ;o)

Finally: My Script and my Table view

So, what do you think…? I think that’s not a quite easy and effective workaround. Hopefully we will see some improvements in the final release of NetBeans 6.


Über sageniuz
Dieser Beitrag wurde unter Databases, NetBeans, Tutorials veröffentlicht. Setze ein Lesezeichen auf den Permalink.

15 Antworten zu How To Rename Colums in Derby DB and NetBeans 6 Beta 2

  1. Anonymous schreibt:

    [u][b]Xrumer[/b][/u][b]Xrumer SEO ProfessionalsAs Xrumer experts, we from been using [url=]Xrumer[/url] quest of a long immediately things being what they are and recollect how to harness the titanic power of Xrumer and turn it into a Bills machine.We also provender the cheapest prices on the market. Many competitors see fit cost 2x or consistent 3x and a destiny of the time 5x what we responsibility you. But we believe in providing great accommodation at a low affordable rate. The entire something of purchasing Xrumer blasts is because it is a cheaper alternative to buying Xrumer. So we aim to stifle that mental activity in recollection and yield you with the cheapest rate possible.Not simply do we cause the unexcelled prices but our turnaround time for your Xrumer posting is wonderful fast. We compel secure your posting done in the forefront you distinguish it.We also produce you with a full log of successful posts on different forums. So that you can catch a glimpse of over the extent of yourself the power of Xrumer and how we hold harnessed it to gain your site.[/b][b]Search Engine OptimizationUsing Xrumer you can think to realize thousands upon thousands of backlinks over the extent of your site. Myriad of the forums that your Install you will be posted on oblige high PageRank. Having your join on these sites can deep down mitigate found up some cover quality endorse links and uncommonly riding-boot your Alexa Rating and Google PageRank rating utterly the roof.This is making your site more and more popular. And with this inflate in celebrity as grammatically as PageRank you can keep in view to witness your area really superiority high-pitched in those Search Locomotive Results.TrafficThe amount of conveyance that can be obtained by harnessing the power of Xrumer is enormous. You are publishing your situation to tens of thousands of forums. With our higher packages you may regular be publishing your position to HUNDREDS of THOUSANDS of forums. Create 1 mail on a in demand forum drive usually cotton on to a leave 1000 or so views, with announce ' 100 of those people visiting your site. Modern imagine tens of thousands of posts on in demand forums all getting 1000 views each. Your traffic liking associate through the roof.These are all targeted visitors that are interested or bizarre far your site. Imagine how innumerable sales or leads you can fulfil with this considerable gang of targeted visitors. You are literally stumbling upon a goldmine bright to be picked and profited from.Retain, Shipping is Money.[/b]TRAVERSE B RECOVER YOUR TWOPENNY BLAST TODAY:

  2. Anonymous schreibt:

    [B][/B]Lose Laggin Downloads With NZB Files You Can Quickly Search High Quality Movies, Games, MP3s, Applications and Download Them at Flying Speeds[URL=][B]Usenet[/B][/URL]

  3. Anonymous schreibt:

    Authentication of gain Our Minuscule Prices at, The Unrivalled [b][url=]Online Dispensary [/url][/b] To [url=]Buy Viagra[/url] Online ! You Can also Espy Gargantuan Deals When You [url=]Buy Cialis[/url] and When You You [url=]Buy Levitra[/url] Online. We Also Would degree a Consequential Generic [url=]Phentermine[/url] On the duration of Your Regimen ! We Huckster Pre-eminence marque [url=]Viagra[/url] and Also [url=]Generic Viagra[/url] !

  4. Anonymous schreibt:

    Adapt the animalistic with two backs casinos? authorize this latest [url=]casino[/url] helmsman and wing it denigrate online casino games like slots, blackjack, roulette, baccarat and more at .you can also brake our untrained [url=]casino[/url] be lacking at and destroy genuine tangled dough ! another exceptional [url=]casino spiele[/url] in the billet of is , because german gamblers, plan manumitted online casino bonus.

  5. Anonymous schreibt:

    I would not recomend it since frostwire is known for viruses on pc and macs [url=]santoramaa[/url]

  6. Anonymous schreibt:

    Someone deleted several links from and netload servers.From now, we will use as our main [url=]url shortener[/url], so every link will be there and visible for everyone.You can choose from several great [url=]short url[/url] address and many others.They include above 60 different available domains and the [url=]url shortener[/url] service work properly for free without any registration needed.So we think it is good notion and suggest you to use [url=]url redirect[/url] service too! Thank you.

  7. Anonymous schreibt:

    Looking for [url=]viagra[/url] ?Approve of Our Indelicate Prices at, The High-level [b][url=]Online To some lengths [/url][/b] To [url=]Buy Viagra[/url] Online ! You Can also Espy Status Deals When You [url=]Buy Cialis[/url] and When You You [url=]Buy Levitra[/url] Online. We Also Make a Dour Generic [url=]Phentermine[/url] In underpinning of the profit of Your Nutriment ! We Vend Reciprocation splotch [url=]Viagra[/url] and Also [url=]Generic Viagra[/url] !

  8. Anonymous schreibt:

    Good fill someone in on and this post helped me alot in my college assignement. Thanks you as your information.

  9. Anonymous schreibt:

    It isn't hard at all to start making money online in the undercover world of [URL=]blackhat hacking[/URL], It's not a big surprise if you have no clue about blackhat marketing. Blackhat marketing uses not-so-popular or little-understood ways to produce an income online.

  10. Anonymous schreibt:

    http://www.pornvideoonline.infohttp://www.pornvideodownload.infohttp://www.pornvideotorrent.infohttp://www.gaypornonline.infowww.teenpornonline.info video online[/url][url=]Porn video download[/url][url=]Porn video torrent[/url][url=]Gay porn online[/url][url=]Teen porn online[/url][url=]Free porn videos online[/url][url=]Best porn video[/url]

  11. Term Papers schreibt:

    I have been visiting various blogs for my term papers writing research. I have found your blog to be quite useful. Keep updating your blog with valuable information… Regards

  12. Anonymous schreibt:

    online surveys [url][/url]

  13. Anonymous schreibt:

    site to [b]buy software for windows[/b] is available at: buy software for windows [url=]buy software for windows[/url] [url=]buy dvd to psp converter[/url] buy 3gp video converter

  14. Anonymous schreibt:

    resource to [b]software downloads[/b] is available at: Windows YouTube downloader [url=]Windows YouTube downloader[/url] betting software [url=]betting software[/url] buy software for windows [url=]buy software for windows[/url] download software for windows [url=]download software for windows[/url] Download Youtube Videos [url=]Download Youtube Videos[/url] FLV to AVI converter [url=]FLV to AVI[/url] DVD ripper [url=]DVD ripper[/url] Video converter [url=]Video converter[/url] Home video converter software [url=]Home video software[/url] Poker software [url=]Poker video software[/url] Shark Video Downloader [url=]Shark Video Downloader software[/url] Simplest YouTube Internet Video Downloader [url=]Watermark Software[/url] Popular screensavers [url=]Popular Screensaver[/url] Hyper YouTube Magic Tool XXX [url=]Hyper YouTube Magic Tool XXX[/url] Free FLV converter [url=]Free FLV converter[/url] Working YouTube downloader [url=]Working YouTube downloader[/url]

  15. Anonymous schreibt:

    ha, I am going to try out my thought, your post give me some good ideas, it's really awesome, thanks.- Norman

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

Du kommentierst mit Deinem Abmelden /  Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )


Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )


Verbinde mit %s