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.

Cheers

Über sageniuz

https://about.me/ClausPolanka
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=http://www.xrumer-seo.com]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:http://www.xrumer-seo.com

  2. Anonymous schreibt:

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

  3. Anonymous schreibt:

    Authentication of gain Our Minuscule Prices at http://www.Pharmashack.com, The Unrivalled [b][url=http://www.pharmashack.com]Online Dispensary [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Espy Gargantuan Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Would degree a Consequential Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] On the duration of Your Regimen ! We Huckster Pre-eminence marque [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

  4. Anonymous schreibt:

    Adapt the animalistic with two backs casinos? authorize this latest [url=http://www.realcazinoz.com]casino[/url] helmsman and wing it denigrate online casino games like slots, blackjack, roulette, baccarat and more at http://www.realcazinoz.com .you can also brake our untrained [url=http://freecasinogames2010.webs.com]casino[/url] be lacking at http://freecasinogames2010.webs.com and destroy genuine tangled dough ! another exceptional [url=http://www.ttittancasino.com]casino spiele[/url] in the billet of is http://www.ttittancasino.com , 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=http://gordoarsnaui.com]santoramaa[/url]

  6. Anonymous schreibt:

    Someone deleted several links from filebase.to and netload servers.From now, we will use http://www.tinyurlalternative.com as our main [url=http://www.tinyurlalternative.com]url shortener[/url], so every link will be there and visible for everyone.You can choose from several great [url=http://kfc.ms]short url[/url] address like:kfc.ms easysharelink.info jumpme.info megauploadlink.info megavideolink.info mygamelink.info myrapidsharelink.info mytorrentlink.info myurlshortener.com mywarezlink.info urlredirect.info urlshrinker.info weblinkshortener.com youtubelink.info and many others.They include above 60 different available domains and the [url=http://myurlshortener.com]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=http://urlredirect.info]url redirect[/url] service too! Thank you.

  7. Anonymous schreibt:

    Looking for [url=http://www.pharmashack.com]viagra[/url] ?Approve of Our Indelicate Prices at http://www.Pharmashack.com, The High-level [b][url=http://www.pharmashack.com]Online To some lengths [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Espy Status Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Make a Dour Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] In underpinning of the profit of Your Nutriment ! We Vend Reciprocation splotch [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]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=http://www.www.blackhatmoneymaker.com]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.infohttp://www.freepornvideosonline.info/http://www.bestpornvideo.info%5Burl=http://www.pornvideoonline.info%5DPorn video online[/url][url=http://www.pornvideodownload.info]Porn video download[/url][url=http://www.pornvideotorrent.info]Porn video torrent[/url][url=http://www.gaypornonline.info]Gay porn online[/url][url=http://www.teenpornonline.info]Teen porn online[/url][url=http://www.freepornvideosonline.info]Free porn videos online[/url][url=http://www.bestpornvideo.info]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]http://www.333eur.com/[/url]

  13. Anonymous schreibt:

    site to [b]buy software for windows[/b] is available at: buy software for windows [url=http://www.buysoftwareforwindows.com]buy software for windows[/url] [url=http://www.buysoftwareforwindows.com/products/buy-dvd-to-psp-converter/productpage.php]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=http://www.1800soft.com]Windows YouTube downloader[/url] betting software [url=http://www.betextremesoft.com]betting software[/url] buy software for windows [url=http://www.buysoftwareforwindows.com]buy software for windows[/url] download software for windows [url=http://www.downloadsoftwareforwindows.com]download software for windows[/url] Download Youtube Videos [url=http://www.downloadyoutubevideos.co.uk]Download Youtube Videos[/url] FLV to AVI converter [url=http://www.flvtoavi.co.uk]FLV to AVI[/url] DVD ripper [url=http://www.flvtodvd.com]DVD ripper[/url] Video converter [url=http://www.hollydollyvideo.com]Video converter[/url] Home video converter software [url=http://www.homevideopage.com]Home video software[/url] Poker software [url=http://www.pokerwinningvideo.com]Poker video software[/url] Shark Video Downloader [url=http://www.sharkvideopage.com]Shark Video Downloader software[/url] Simplest YouTube Internet Video Downloader [url=http://www.simplestutils.com]Watermark Software[/url] Popular screensavers [url=http://www.popularscreensaverpage.com]Popular Screensaver[/url] Hyper YouTube Magic Tool XXX [url=http://www.andromedaapps.com]Hyper YouTube Magic Tool XXX[/url] Free FLV converter [url=http://www.cassiopeiasoft.com]Free FLV converter[/url] Working YouTube downloader [url=http://www.pegasusapps.com]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

Schreibe einen Kommentar

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

WordPress.com-Logo

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

Twitter-Bild

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

Facebook-Foto

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

Google+ Foto

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

Verbinde mit %s