Vgo Software

Entries in JDeveloper (21)

Monday
Nov052012

ADF View Objects with Dynamic Where Clauses

While working on a recent modernization project I came across a scenario in which a View Object used by a page had a different where clause depending on one of the values passed in.  All in all, not too big of a deal, but because the where clause used a number of parameters and the parameters used changed along with the where clause it introduced some complications.  So to save you the trouble I thought I'd write about a couple of them here.

First of all, it is easy enough to to create a method in an Aplication Module implementation class that adjusts the where clause to what you need using the ViewObject.setWhereClause(String whereClause) method.  To set the parameters you need to use the ViewObject.setNamedWhereClauseParam(String paramName, Object paramValue) method.  What I found was that I had to have the parameters set at Bind Variables in the View Object and they must have their required property set to true, otherwise they are not really bind variables.  

What that means is that to execute the query, it must contain all of the bind variables even if they are not being used.  That means putting them in the where clause all the time.  To accomplish this for bind variables that were not used, I just put something like "and :par1 = null" and set the value to null using the above method.

This works fine except that since the bind variables are not in the original query definition another problem was encountered.  As soon as the task flow opened, the first thing it had to do was run the method I defined in the Application Module, unfortunately that did not happen.  Instead the first thing that happened was that the View Object executed and returned an error because the bind variables were not in the query.

Apparently in order for my method to work, I needed a page definition file that allowed my method to access my View Object's iterator.  Because this iterator was in the page definition file, ADF executed the query upfront even though nothing that used it was being called yet.  In order to fix this I set the refresh property of the iterator in the page defintion to "never".  This means that the iterator will not execute unless refresh() or execute() are called programattically on the View Object.  Of course this happens in the Application Module method that sets up the where clause after the where clause has been defined with the parameters in it.

That's it, simple enough once you realize what is happening, but a little frustrating before that light bulb goes on!

Monday
Jun012009

Book Review: Processing XML documents with Oracle JDeveloper 11g

This is a new feature here on Java Hair, a book review. I was recently approached by the publisher of this book who asked if I would be interested in doing a review. The request was quite timely, I thought, since I have recently been working with XML Schema design (check out the XML category). 

“Processing XML documents with Oracle JDeveloper 11g” seems more like the title to a whitepaper than a full-fledged book, but I found that the book actually covers a lot of topics that fall under the XML Processing umbrella. That, and the fact that JDeveloper documentation can be difficult to come by makes this book a pretty handy addition to your library if you develop with JDeveloper 11g and you are working with XML. 

Starting out, the book covers the parsing of XML documents using both the SAX API and the DOM API. Information that you could get elsewhere, but as the book is JDeveloper 11g specific, it also includes information on how to set up your projects and which libraries you need to include that may or may not be included with your JDeveloper distribution. Very handy information for someone using JDeveloper. 

There is a chapter on using JDeveloper to design an XML Schema, something I could have used a few months ago, actually. JDeveloper’s visual design feature for XML Schema’s is a great tool and comparable to anything I’ve used with Eclipse and NetBeans. Following that is a chapter on validating your schema 3 different ways and how to create these projects in JDeveloper. 

There are some chapters that I didn’t expect to see in this book, but were quite welcome. A chapter devoted to transforming XML to PDF, another on transforming XML to MS Excel, storing XML in Oracle Berkeley DB XML, and even a chapter on Oracle XML Publisher. 

So all in all, despite the self-imposed limitation of XML and JDeveloper, the author, Deepak Vohra, has managed to cram in some very useful topics into his book. Though some of it isn’t really JDeveloper specific, he does makes it relevant by walking thru setting up each project in JDeveloper as well as building and running the subsequent applications in JDeveloper. 

The writing style is very dry, much like you’d probably expect from a reference book, and it should be treated as such, it isn’t something that you are going to want to sit down and read in one sitting. However, if you have work to do in XML and you are considering using or already using JDeveloper as your IDE, I would definitely recommend picking it up. 

You can find the book on virtually any online bookstore or on the publisher’s website: Packt Publishing.
Monday
Apr202009

Oracle acquires Sun: Who needs to look out now?

As a Java developer who does a lot of work with Oracle products including Jdeveloper and ADF, my head is still spinning a little from the news that Oracle is buying Sun Microsystems

Oracle buying BEA hurt a little, though it was completely expected and a great move on Oracle’s part, I was a little sad to see the application server competition field drop by one but I was very happy that Oracle was smart enough to choose Weblogic. At that point it was really the only the decision they could make. 

With Oracle buying Sun there is a lot of synergy, there are many technologies that are duplicated among both companies. Oracle owning both should make those technologies better and enable them to compete with the leaders in those respective areas. The big ones that stick out for me:

1. Oracle’s JDeveloper and Sun’s NetBeans 

Could they really afford to drop NetBeans, probably not, but can they afford to drop JDeveloper, no, not really. Here the only thing that really makes sense is to merge the two, probably adding in the ADF wizards and goodies like that into NetBeans. At least, that is what I hope they do. JDeveloper isn’t bad, but I only ever use it to develop ADF projects and I bet many, many people are in that same boat. Combining the two could end up giving Eclipse a run for it’s money, hopefully the competition just spurs both to be better.

2. Oracle’s Oracle VM and Sun’s Virtual Box

I haven’t had much experience with Oracle VM, but I have lately become a huge fan of Sun’s Virtual Box. It’s a great product and it lets me do everything I want for free. Will this continue to be the case? I don’t know. I’m not an expert on virtualization in the enterprise, I use it for desktop VMs, but I hadn’t seen much about Virtual Box working in that space. I would imagine Oracle VM is all about virtualizing the network and competing with VMWare on that level. With the two together VMWare’s got some competition.

3. Oracle’s Unbreakable Linux and Sun Solaris

Oracle had a great jumpstart to their linux platform basing it on the RedHat codebase way back when. Solaris was my first exposure to any type of Unix (Solaris and AIX, actually) and it has been around forever. If the adoption of Linux has hurt anything, it’s probably been Solaris and through that, sales of Sun’s hardware. Oracle says that their owning of Solaris will enable them to tune the Oracle Database software to run even better on it, and since according to Oracle, most of their database customers are using Solaris, I think they’ll probably do that. I have no idea what will have to Unbreakable Linux though. Who has to look out with this one? I’d say IBM. Buying Sun probably would have been good for them in the products space, I think the only area IBM is going to be competing in future is going to be services. RedHat has Ubuntu to worry about on the desktop side and now a bigger threat from Oracle and Sun on the server-side, they have their work cut out for them.

4. Oracle Database and Sun’s MySQL 

MySQL has a huge customer base, most of them probably non-paying. I think with this one, Oracle just adds it to their ever increasing repetoire of niche databases. It won’t go away, but I see less adoption in the future, maybe a boost for PostgreSQL if they can get their act together.

5. Sun’s Java and Oracle’s ADF 

Oracle has always been a big player in the specifications for the Java language. I’m sure someone else will go into all the details, because I honestly don’t know them off the top of my head, but I do know that many technologies and ideas that ADF is based on where either approved JSR’s or close to approved JSR’s. Does Oracle’s acquisition of Sun and Java mean that they will be better equipped to push trhough whatever they want to add to the language? Well, I don’t think it will be quite that easy, but I’m sure it makes it easier. 

I’ve always been a Java guy at heart, I work with Oracle technology sometimes, and I think they have really come a long way, but Oracle owning Java does kind of scare me a little. One thing Oracle does really well, and JDeveloper is great at this, is making complex technologies easy to use. It is what Microsoft does really well. .NET makes easy the things that Java makes hard. ADF actually does a lot of the same. The combination of ADF and Java together could pose a big threat to Microsoft’s .NET if Oracle does it right. 

My first thought about Oracle owning Java is that many developers are going to jump up and down about it and complain. Some will probably jump ship, maybe to .NET but probably to Ruby or PHP or something else. I don’t think many corporations are going to change the direction of their IT departments though, so for them, it will be .NET or Java as it always has. In the end, I think most Java developers are going to remain Java developers and hopefully Oracle’s backing of Java will just end up making it a better language to work with. 

Microsoft might have more to worry about with Oracle owning Open Office now also. I hope that Oracle continues to invest in it, or it’ll end up being Microsoft Office vs. Google Apps and that’s about it. I’m all for cutting edge, but Gmail hasn’t come out of Beta yet and I’d like to see Microsoft have some competiion in this area. 

So I wanted to get my thoughts out there while they were floating around in my head and hopefully yours so I could hear your opinions on the topic. Please let me know what you think about this acquistion and what you think it means to the future of technology and competition in the field.
Friday
Jan302009

Speaking Engagement: Collaberate 09

It looks like my abstract was accepted to be presented at Collaborate 09 coming up in Orlando in May this year. As the schedule stands now my session will be first thing Monday morning (first thing being 10:45 thankfully!), which leaves me the rest of the time to see what’s new in the world of Oracle and Oracle Users. 

In case you haven’t heard of it, as their website says: “COLLABORATE 09 helps users of the full family of Oracle business applications and database software gain greater value from their Oracle investments. Created by and for customers, COLLABORATE 09 offers an expert blend of customer-to-customer interaction and insights from technology visionaries and Oracle strategists. Expand your network of contacts by interacting with Oracle customers, solutions providers, consultants, developers and representatives from Oracle Corporation at COLLABORATE 09.” 

So if you are going to be there, be sure to stop by my session and say hello.
Monday
Jan052009

Installing JDeveloper 11g on Ubuntu 8.10

I recently got a little annoyed at Vista and upgraded my desktop workstation to run Ubuntu Linux. As it has been the holiday season and I’ve been busy modeling in XML (more on that later!), I hadn’t had the chance yet to install or run JDeveloper 11g on my newly configured desktop. Today I decided as part of the new year, I’d take the plunge and give it a whirl. 

Here are the steps I followed to install JDeveloper 11g on Ubuntu. 

1. First off, download the installer from Oracle here: http://www.oracle.com/technology/software/products/jdev/htdocs/soft11.html. I downloaded the Linux install that includes JDK 6 as running java -version at a terminal in Ubuntu revealed that I was running 1.5.0. 

2. Change the permissions of the downloaded bin file to allow execute. chmod +x jdev* if you are lazy like me. 

3. Open a terminal window and change directory to the directory where the downloaded file is. 

4. type ./jdev* to run the downloaded file, as long as there are no other files whose name begin with jdev in that folder, if there are, type the whole thing out. 

5. Choose complete install - you are going to need it all anyway. 

6. I allowed it to install under my home directory. 

7. After it installed and the Quickstart Launcer appeared, I chose to open JDeveloper Studio. 

8. Since the installer did not create a menu item for me in my Applications Menu, I did that manually. 

9. Right click on the Applications Menu and choose “Edit Menus”. 

10. Select the Menu you want to add the entry to, I chose “Programming”. 

11. Select “New Item”, for the Type choose “Application”, for the Name: “JDeveloper”, for the Command: “[Install Dir]/Oracle /Middleware/jdeveloper/jdev/bin/jdev” replacing [Install Dir] with the correct path. 

And that’s all there is to it. Probably not even worth a post at this point, but since I typed it while installing it and I didn’t realize it was going to be so painless, I might as well post it anyway. I’ll post again about it if I run into any quirks using it, hopefully it’s as seamless as the installation was.