Configure player

Close

WWDC Index does not host video files

If you have access to video files, you can configure a URL pattern to be used in a video player.

URL pattern

preview

Use any of these variables in your URL pattern, the pattern is stored in your browsers' local storage.

$id
ID of session: wwdc2005-605
$eventId
ID of event: wwdc2005
$eventContentId
ID of session without event part: 605
$eventShortId
Shortened ID of event: wwdc05
$year
Year of session: 2005
$extension
Extension of original filename: mov
$filenameAlmostEvery
Filename from "(Almost) Every..." gist: ...

WWDC05 • Session 605

Using Oracle JDeveloper with Oracle 10g on Mac OS X

Enterprise IT • 1:07:19

Oracle JDeveloper is a great Java development tool for Oracle 10g on Mac OS X. Bring your laptop to this hands-on session and learn how to build a Java application using JDeveloper connecting to an Oracle database, as demonstrated by Oracle. This session will be valuable for in-house developers and developers at ISVs.

Speaker: Shay Shemltzer

Unlisted on Apple Developer site

Transcript

This transcript was generated using Whisper, it may have transcription errors.

All right. So welcome, everyone. My name is Shai Schmelzer. I'm from Oracle. And welcome to the Developing J2E Application Using Oracle JDeveloper. And what we'll try to do today in the session is take you through the process of developing a complete J2E application using the Oracle development tools, which is called JDeveloper. Just to get a feeling of the audience, How many people here are currently doing Java development?

Okay, we have a few of them. How many people here actually have JDeveloper currently installed on their machine? Okay, just a few. Because the original thought was for you to follow what I'm doing on the stage and duplicate it on your machines. And how many people of you actually have an Oracle database on your machines? All right.

Okay, so we expected this might happen. So what we did is we basically plugged in my PowerBook into the network, and there's a database running on this PowerBook, and I let you access it, for those of you who will be following step by step. But note that since we are doing it through Wi-Fi connection and since we are using a PowerBook as a server, it might not perform that well, right? So just a head notice. Right, so even for those of you who don't have JDeveloper on your machines, I think by looking at what I'm doing today, you should be able to go back to your office later on today, download JDeveloper for free, install it, and run through it, and I'll also show you where you can get step-by-step instruction for doing what I'm doing and doing even more. So... This is our topic today. And I'll start by giving you a short overview of what JDeveloper is. JDeveloper is Oracle's Java development environment, but it is more than just a Java development environment. It is basically a development environment that we use for building database objects, and creating XML files and XML schemas, and creating web services, and creating anything that has to do with Java, as well as creating other stuff. which I'll explain later on. So it's a single IDE that we expect to be used for any type of development. JDeveloper itself is written in Java, and therefore it runs on a Macintosh or any other machine that has Java on it, which is one of the benefits of having Java. So we actually don't expect any problems taking JDeveloper and running it on the Intel-based Macintosh machines. We probably should try it out this week.

JDeveloper also supports the full development lifecycle. So some people like to actually design the application before they build it, which is a strange way of doing stuff. But usually it results in better quality of an application. So inside JDeveloper, there are UML modelers that let you design your application. There is also, for example, a database modeler that lets you design your database structure and create the tables that you need in your database. After modeling, you can actually generate code, and the code and the modelers are synchronized at all times. After that, you go into the coding environment. We have a lot of graphical utilities and helpful things to help your development process be more fluent. And once you are finished developing, we have debugger, tester. We integrate with JUnit so you can do unit testing.

We integrate with N so you can build your projects. and we integrate with CVS, so you can do version management of your files, okay? And we also support deployment, so we give you one-click deployment to Oracle's application server or JBoss or Tomcat or WebLogic, and basically, JDeveloper creates standard J2E applications, so you can take what we create in JDeveloper and deploy it to any J2E-compliant application server that is out there, right?

And that's basically a nice segue to the second point, which talks about the fact that whatever you create in JDeveloper is completely standard. We use standard J3, standard XML, standard HTML. Nothing is Oracle proprietary. You can choose your application server, and you can also choose your database. So if it happens to be that you don't have Oracle on your machine, but you have MySQL, you should be able to do the same stuff that I'm doing with the Oracle database using MySQL or any other database for that matter.

So because you're using JDBC, basically. As I mentioned before, we integrate with open source standards and open source utilities such as JUnit, CVS. We have exceptional support for the STRATs framework that you'll experience later on. And JDeveloper itself has an extension API. So if there's something we missed while we built JDeveloper, you can always use the extension API to integrate other capabilities and other products into JDeveloper, add functionality. And we have an extension exchange on our website that lets you download, I think, currently about 50 extensions to JDeveloper. That do everything from code formatting to building wireless applications.

The main focus for us when we develop JDeveloper is on ease of use while you're developing your application. So what we are trying to do is bring sort of the power of a 4GL environment into the J2E world. But still keeping intact the fact that you can always access the code. So you'll see me doing a lot of stuff using visual tools and dialogues instead of actually going and hard coding Java. I can always switch to the code view. And you can always go and edit the code. the actual Java code. So the way that we make everything simpler for you is by providing you with a framework while you're developing. And this is what we call the Oracle Application Development Framework, or Oracle ADF.

Oracle ADF aims to simplify the way that you build J2 application by giving you certain utilities. There are some principles that we use when developing this stuff. First of all, what we try to do is provide you with solutions to common problems or common needs when developing a J2 application. So if you ever developed a J2 application, you know that you need, for example, a layer that will enable you to map your object world, the object that you create in the Java language, to relational tables in the relational database. assuming that you are using a relational database. Then after you do this thing, you might want to use caching and persistent solution.

If you're creating a web application, you need a framework that will allow you to control the flow of the application, how one page leads to another page when you're operating with them. If you're creating user interfaces, you might need a set of user interface components that you can just pick up and use in your application instead of building complex UIs on your own.

Oracle ADF provides you with all those layers and services and much more inside it. Oracle ADF is not the only solution out there that provides those types of components and services. It's the only framework that actually gives you all of them in a cohesive way and in a single way of using them and ties them all together and doesn't leave it up to you to try and integrate the different parts of your framework. Another thing that makes it unique is that it also provides visual tools to let you build those services. So if you take for example open source frameworks, for example for OR mapping there's a popular Hibernate open source project that lets you build OR mapping. But if you're doing Hibernate, you're mostly dealing with editing XML files. We, on the other hand, give you a visual tool to create your OR mapping. And we can do a lot of things faster by doing this. So it's not just about providing solution, it's also about giving you an easy way to use this solution. As I said, portability and compatibility is always important for us. ADF can be deployed on any application server that supports J2E.

We support different development approaches. So some people prefer to just go ahead and start coding Java, directly access the code. Some people would like to first do modeling and then generate code, what we call MDA approach. Some other people would like to work with visual tools and wizards and dialogues. And your development team usually comprises of people from all those areas, of those preferences. In JDeveloper, you can use each one of those approaches, but everyone works on the same file from the same environment.

So if I'm doing a Strats page flow, and I prefer to do it visually using drag and drop, another guy can go to the same file I created and edit the XML file directly if he prefers to. So the same framework can be used by different types of developers, which is a very important fact for organizations who have many developers. And we always keep the white box approach. You can always access the code and look what's happening behind the scene.

ADF is based on the MVC architecture for building application. MVC architecture separates your application into three distinct layers, which makes development easier and maintenance easier and makes it easier to plug and change components without needing to change everything in the system. So there's the view layer. That's the V. View layer has to do with the way that you display data. and we support both rich clients as well as web clients. So you can build a client server type application or you can build a web application accessible through a browser. There's the controller, which is an important part for web application, controls the flow between the different pages. We basically use Strats, which is the de facto controller for Java server pages in the market. And there's the model layer, which is the layer that does your business logic and connects to your data. What we did is below the model layer, we basically created a layer called the business services layer. that allows you to implement your business services in different ways and plug them in the same way to your model layer. So business service can be, for example, built as an EJB, Enterprise Java Bin.

Some people say that EJB are overhead and they prefer, for example, when they do access to database, they take the POJO approach where they simply create Java objects that access the database directly. So you can create business services in POJO. Some people say we want to do a service-oriented architecture and all our business services are exposed as web services. So this is another way to build a business service. And we let you take each one of those and plug it into the system and use the same way and the same development approach to do the rest of the development.

So what we'll be doing today? Basically, we'll do a very basic application to manage employees and departments, which is the usual Oracle demo. The steps that we'll be doing is first, we'll create Java classes that access the database and do all the operations against the database. We're going to use Oracle TopLink, which is Oracle's persistent solution for POJO objects. Then we're going to build a JSF user interface on top of this there. So create web pages to allow you to actually access the database and see data, update data, add data.

To control the flow of the application, we are going to use Strats, an open source framework. And if we'll have enough time, we'll also try to create a web service based application. I don't know if we'll have enough time at the end. If not, you can come down to the demo booth, to the data center area, and we'll show you how to do it over there.

Some words about TopLink. TopLink is a way for you to do object relational and persistence. So it basically takes Java objects and maps them to a database. The nice thing is that it can do it in two ways. One way is to start with existing tables in the database and just create Java objects from those tables.

The other approach is that you let the Java people design their own object. and you let the database people design their own tables. And then you do what we call the scenario of "meet in the middle," where you map existing Java objects to existing tables, and you tell the Java objects how to persist data into the tables.

So this is basically what TopLink does. It also does all the persistence stuff, which means all the create, read, update, delete operations on the tables without you having to write a single line of JDBC to access the database. It does it automatically for you. Manage transaction lockings and those type of things.

It has advanced caching mechanism, so it can cache data in the middle tier, to reduce the number of network traffic that you do to the server and offset load from your database machine. There's a lot of tuning options that we won't go into today, which let you control the way it behaves. And it's a non-intrusive solution, which means that it doesn't actually go into your Java code and you don't change anything in your Java code in order to persist your data. Everything is done externally in XML files.

It has a flexible deployment approach. You can deploy TopLink as a CMP for EJBs. You can deploy TopLink as a server object, or you can deploy TopLink in a client server mode, running on the client, accessing the database. Another thing we'll do today is web interface development, and we'll be using the Visual JSP Editor and the Visual Strats Editor in JDeveloper to do this in a nice and easy way.

So if you don't have the software on your machine currently, this is where you'll be getting the software later on. We have a website called OTN, the Oracle Technology Network, and you can basically download JDeveloper for free from this website. It's the complete version, no time limit. Just go ahead and play with it. There are currently two versions of JDeveloper. Actually, there are more, but the two relevant versions of JDeveloper that are out there is 10.1.2, which is our current production version, which we'll be using today. And there's also a preview of our next version, which is called 10.1.3, but probably should have been called 11, because it's a major rehaul of the interface and a lot of new features in there.

JSF, EJB3, a lot of other stuff is in there. So you can download both of them running on the Mac and play with them and see how you like them. And if you need an Oracle database, this is the URL to get your Oracle database for Macintosh. The first link is to the JDeveloper homepage on OTN. So the way that we keep communication open between us and the developer community is through that page, basically. Over there you can get tutorials and demos and code samples and how-tos and all the stuff that we offer, basically. Along with a discussion forum where you can ask questions and get answers, hopefully. and extension exchange where you can get all the extensions to JDeveloper and more and more. So basically, you can either write down the URL or just go to Google and do a search for JDeveloper. It will take you there as the first link. All right, so let's switch to Demo Machine 2.

where I'll be developing the application. And this is basically what you should be having on your machine as well if you want to follow up. Startup jdeveloper 10.1.2. Okay. If you have a database on your machine, you might want to start that one as well. So I'll start my database.

And inside JDeveloper, when you first start it up, you'll probably see something like that, which means that you currently don't have anything and you have a little welcome page with all the links to all the pages and the information that you need. You can probably... Yeah, sure. One thing I can do is get you all to sit a little closer. This is one way. And I think I actually did something about the font size. So if I do application... For the dialogues, I can't actually do it for the dialogues, but I think for the actual code editor, I did increase the font. But again, as with any demo, you should probably sit in the first row if you want to learn. So, this is the font that I'm going to use when coding. But I'm not going to do much coding, so I'm just going to close this and delete it. Alright, so... Once your database has started, you should be able to connect to it from JDeveloper. If you don't have a database on your machine, this is what you're basically going to do. There's a connection tab that lets you define connections to various places, like your application server.

So this is where you can define a connection to the Oracle application server or a BEA application server, and this would let you deploy your application easily later on. You can access your UDDI registry to look up web services. You're interested in the database connection tab. And if you don't have anything in here, you basically right-click and choose New Database Connection.

Click "Next" and give a nice name to your database. So this is going to be the WWDC database, if you're following with me, okay? Again, here you can define your JDBC, the type of JDBC that you are going to use. I'm going to use the Oracle JDBC, but you can add JDBC drivers for other databases. Next, username and password. It's very easy here. It's HRHR, human resource. And also click the deploy password checkbox. It would make it easier to save you the login screen each time you run the application.

So hr, hr, and the username and password. By the way, if you are having any problems, Gary is here from the JDeveloper team, and he'll be trying to help you. So if you have any problems following with me, just raise your hand and Gary would try to help you. We'll see how it works. Then you go to the next step, which is defining the database connection to the server. So you need a host name. I actually have a host name.

It's not a host name, it's an IP address. So the IP address is supposed to be showing up here any second now. Okay, if it doesn't, let me do it the other way. So I'll click cancel here, but keep this form open. You'll keep the 1521 here and the ORCL uppercase over here as default. The IP address that you actually need is-- 206.13.37.55. And this would get you connected to the server machine.

I'll keep this on the screen for a second or two. Again, remember, this is not a very powerful machine, and I'm hoping that it can handle the load from the guys who actually are following up. You can then go to the test tab, click test connection. It should bring up success. If it doesn't bring up success, it means that something went horribly wrong before that. But don't panic. Gary is here to help. Let me just copy this in case someone will need it later on. Yeah, so... This is the IP address. Write it down somewhere in the notepad, and you can access it. All right. Let's keep it down here.

So once you have your database connection, you're basically ready to work. Switch back to the application tab. And the application tab is basically where you see all the components of your application. Currently, you don't have anything. So if you actually right-click or Control-click here, you're able to choose New Application Workspace. Application Workspace is a way for you to manage multiple projects under a single roof, letting you build projects that depend on one another. Create a new application, give it a meaningful name, like the WWDC demo. You can specify an application prefix if you want to. And then you can specify the template that you are going to use. We are not going to use any template for this run. The template, let me explain the concept, the template lets you specify a set of technologies that you are going to use in this specific project.

For example, as I told you before, you can use EJBs in JDeveloper or you can use POJOs and you can use JSPs and you can use stats or you can choose not to use stats. And JDeveloper has everything in it. And when you create new stuff, it would basically show you a new gallery of the things that you can use. This is a way for you to limit the number of things that it displays to you to only show you the things that you care about. By choosing no template, you tell it basically show me all the technologies that you have. So we'll choose no template, click OK, and it creates project for you. And it calls it project, which is not very meaningful, so you can go and do file, rename, and rename the project into model. Because this is the model layer for our MVC architecture.

Everybody is here so far? Everybody is following? All right. So for the other guys, it might seem slow, but when I actually do it without expanding, I can do it in like 10 minutes, so bear with me. All right. So you have your model layer. If you double-click the model layer now, you'll go into the project properties where you can specify things as which compiler version I'm going to use, which JVM I'm going to use, et cetera. What I'm interested in for you to do is go to the technology scope.

where it lists a bunch of technologies that you can use in your project, click on Top Link in the list and Shuttle Top Link to the right. This will allow you to add Top Link components to this specific project. So under Technology Scope, Top Link, go to the right. And now when you actually right-click on the project and choose New, you will have the TopLink node over here. And this will allow you to create Java objects from tables in the database. So what I'm going to do now is basically go to my database, pick up some Java--some tables, and create Java objects to access those tables, right?

Click OK, you get a little wizard. You go through the motion of selecting the various things. So here you choose the database connection that you're going to use. Then you'll see the list of tables. and you should have department and employees, which are the two tables that we are going to use for this demo. You choose those two, and you shuttle them to the right.

And here you basically see the names of the classes that are going to be generated for you. Don't bother to change them. Just click next again and click finish. TopLink now goes to the database, finds out the structure of the tables, finds out about any relationship between the tables, and created basically two Java classes right here that interact with those tables. If you double click on the classes, you'll actually see the code. On the left side over here, you actually see the list of methods that it provides you. And it basically gives you a getter and a setter for each column in the database, as well as add methods for collections that are nested inside objects. So in the list here in the structure pane, look for a method called setLastName and double-click on it. This will take you directly into the setLastName place in the code. And this is the current business logic that it does, which is not very complex. So let's add some business logic to this operation, to this method. So do something like that. Write "if" and then press "Ctrl" - "Return".

It automatically completes the "if" structure for you. JD Developer comes with code templates, with existing code templates, as well as code templates that you can add. So it's a very easy way for you to reuse code that you do a lot of times. You can basically just type it and it will pop up. Okay, so "if" last name, which is the parameter that this method gets.

click the dot, it will come up with the methods that you can activate on the last name object. You're looking for the equal ignore case method. So just type EQ, okay, and it will give you that one. And you can add here a name. This would be the name. You can put your own name here to make it better. And then you need to do something if this is the case. So type "sop", which stands for "System Out Print", and click "Ctrl+Enter" again. It completes it. And here you can write something like, "I got high as input."

It's not very complex business logic, but it's just to show you the concept. When you write validation logic or stuff like that, you write them in the Java bin, in the Java world, without actually caring about how I'm going to access the database and retrieve the values from the database and insert them into the database. I'm just working in the object view of stuff. All right. You can compile everything just to make sure that you didn't do any mistakes. There's a little compile button up here. One of those two. One is compiled, one is rebuilt. The next step is to click on the TopLink mapping, right-click on it and choose "New Session XML".

New Session XML creates the Session XML object, which basically, if you double-click it and click Add, just use the default name that it provides you, the Session XML controls all the aspects of how you connect to the database in terms of managing, connection pooling, logging, caching, and stuff like that. We won't go too deep into this, so just create one by clicking the Add, And you can save everything and close this window by clicking here.

Then click again on the TopLink mapping, right-click on it, and choose Generate TopLink Deployment Descriptor. The TopLink Deployment Descriptor-- it pops up a little wizard, fills it out. TopLink Deployment Descriptor is basically the XML file that maps all the Java objects to the specific columns in the database and does everything for you. Everything was generated for you. You don't need to change anything. If you want to, you can change.

But for this demo, don't. All right. Basically, you right-click on the TopLink mapping and choose "Generate TopLink deployment descriptor." So by now, what you should have is two classes, a session object and a deployment descriptor XML file. What you can do now is right-click on the department class and choose New Sample Java Client.

And the new sample Java client creates some basic code that you can run by clicking on the run icon over here. That would access the database and retrieve all the departments using TopLink. Just to verify that the code that you did so far works. And it would show it up over here in the log window. So you can see the information coming from the database.

Let's say an optional step so you don't have to do it if you don't feel like doing it. And hopefully it works over the wireless as well. All right. So this is our model layer for our MVC. We created some Java objects, we added business logic, and we made sure that they can access the database and do everything for us. The next step is to build some nice user interface on top of it. So what you'll be doing now is standing on your workspace, which I call WWDC demo. Right-clicking on it and choosing New Project. Choose an empty project and you can name the project View. And this is where we'll create our view layer. So we created a new project called View.

And by double-clicking on the project, you can go to the preferences or the properties of the project, go to the technology scope node, and shuttle to the right strats and Java server pages. and servers. So, strats and JSPs, move them over to the right side. That will allow you to create strats diagram and Java server pages in this project.

Okay, so it actually created a strats config XML file for you. Double-click the strats config XML file, and it will open the strats page flow modeler. And this is basically what you're going to see. It's an empty page. At this stage, you might want to zoom in just to make sure that it is empty, because it is empty. And here is basically where I'm going to define the flow of the application.

Which page is going to call which page. So we'll start by choosing from the component palette on the right side. Choose the data page. And click anywhere in the empty area over here. And it will create a data page for you. And name this page browse. Make sure there's a slash before the browse. You can actually name it whatever you want. You can even keep the default name. It's okay with me. And for those of you interested in looking at the code view, you can switch to the source tab, and you can see the code for the Strats page flow. This is basically just a nicer way to look at the same stuff.

If you want to edit the look and feel of the browse page, just double click on it and choose the JSP page. Click OK. This would take you into the Visual JSP page editor, where you can create HTML pages and JSP pages. So over here you can just write some text like "Welcome to my app". You can format the text by doing "head 3" and this one can be "head 1". If you right-click here and choose "Split Document", you can see the HTML code behind this stuff. You can change the HTML code.

and it will be reflected automatically in the visual stuff. So whatever makes you feel more comfortable. If you're the type of person who writes HTML directly, go ahead and do it. How about adding some stylesheet to this page? On the component palette, you can choose the stylesheet, the CSS page of components, and just click the JDeveloper to implement a stylesheet on your page. Make it look a little nicer, I guess.

Okay, now what I want to do is I want this page to actually show me the departments from the database. Okay, so I have the department as a Java object in my other project. How can I bring them over into my page? So you should have here a data control tab, which is empty currently. If you don't have it, go to view and check the data control palette. and just make sure it's visible over here on the right side. And what I can do now is if you go to the model project, click the department tab, and just drag and drop it into the data control palette, choose session configuration and choose the two values that are in there.

What I just created is a visual way to look at the Java class as a data component that I can use in my JSP. So I can see the departments and I can see the various columns that each department has. And this is basically a method called read all departments.

And it has a return value which is a collection of objects. So, stand on the return. Over here, choose read only form in the drag and drop as box. And drag and drop the return into your page. Into an empty area on your page. This creates three fields with three labels to show you the information about the departments. While still sending out the return, choose navigation buttons and drag them directly after the table, but inside the red rectangle. So inside the same form object, just add the buttons. And those buttons basically let me scroll through records, moving to the previous next record then scrolling to the last and first record.

Next, you can see that the department has embedded inside it a collection of employees, because each department has employees. So, while standing on the employees collection, you should have it as read-only table, drag and drop it right after the buttons. And this creates a table of employees. So again, this is the JSP visual way of looking at it. This is the code version. And the code version, if you look at it, it's basically using expression language to bind to our Java classes.

Alright, our page is ready to be operated. So go back to the Strats Config tab, go to the Browse page, right-click on it and choose Run. What this will do is start compile everything, make sure everything is compiled, okay? And then it would start up the embedded J2E server that comes with JDeveloper. So while you're developing J2E applications, then you want to test them and run them and see if everything works, you don't have to deploy to a remote server. Everything is inside JDeveloper. You don't even have to bother with the configuration of deployment descriptor files. You just click run, and it automatically invokes the J2E container, and goes to your page. I'm guessing it won't find the IP address, so let me just change here the IP address to... 1-27-001, which is the local machine. Click Enter.

and this is the page we just created. You can see department, employees. You can scroll to the next department, and you'll see the next department. Scroll next, and you'll see the employees for that department. And this should be working on your machines as well if you followed everything. So... This is a basic browser application. How much code did I need to write?

Nothing so far. Everything is drag and drop. Behind the scene, a lot of Java code was created for me. But we give you a nicer way to do it instead of just coding. Alright, you have this application which is very nice, but it only lets you see data. You also want to be able to insert and update information. So, let's do it. Let's add another data page to our Strats page flow. So, click data page, click an empty area, and call this page the edit page. With a slash at the beginning. Just one slash.

and double click the edit page to take you to the jsp visual editor And while you're standing on the employee collection underneath the department, this time choose input form in the drag and drop as, and just drag the employees as an input form onto your JSP page. So this would create a JSP page with input fields for each column in the table. So you will be able to insert information about the employees. And then you click submit, and submit would basically save the data. So let's specify that when we click Submit, we want to go back to the page that shows us the employees and departments.

You do this in Stats. You basically do it by specifying a forward from the edit. Click on the edit. Then click on the Browse, and you get the link. The link is currently called Success. In the Property Palette, just rename it to Submit. Make sure to use an uppercase S. Submit. Like that. Right? So now we know that from the Edit page, we can go back to the Browse page. But we also want to go the other way around. We want to be able to go from the Browse page and create things. So click on the Browse page.

And let's add the operation for creating an employee. If you actually expand the employee object over here, you'll see over here the operations for the employee. click the create and drag and drop the create into this empty space right here. There's an empty cell here. And it will basically create a button for you that enables you to create a new employee.

and this will invoke the create operation. The next step is again optional if you want to. Basically you click on the lowest left cell and you go into design, table, split cell and click OK. This creates another cell in your table. And this time, in the operations, choose the set current row with key. It's the first thing that looks a little differently than the other operation.

Choose find row link. So it will be embedded as a link, not as a button. And drag and drop it into this little empty cell that you just created. So if you saw the application before that, we basically had many employees. And I want to be able to select a specific employee from the multi-record table and edit the details of this employee. And this is basically what I did now, is I just specified that I'm going to choose a specific row in this multi-record table.

And it created this link. When you're standing on the link, you can actually see the href or the URL that it's going to call. You need to go to the end of the URL and specify the event. So you do ampersand event equal edit. At the end of everything there. Thank you. This basically tells our strats diagram that in the event of someone clicking this link, I'm going to invoke the edit operation. So let's go back to the strats page flow. Thank you.

and add a forward link from the browse page all the way to the edit page in the event of someone clicking the edit. Make sure uppercase, lowercase is important here. So the name of the link should be edit. And then do another forward from the browse page to the edit page. And this would be in the event of someone pressing the create button, so this one will be create. Again, C in uppercase. And this basically completes your application. You have two pages, you have navigation built between them. And other stuff that you can do, you don't have to do it on your machines. I'll just do it on my machine. You can do stuff like design a table, split cell, add two more empty cells in order for you to be able to click from operation, the commit operation, Okay, so transaction management, it's commit as well as rollback.

And that's your application. Back in the strats diagram, right click on the browse, choose run, and you're running your new application. It again compiles everything that has changed, starts up the web server. Again, it won't find this IP address, so I'll change it to my local IP address.

If you're interested, I can show you later on how to make sure it won't pop up this. So now I have my page. I can actually create a new employee by pressing the create button. And then I can insert some information. So you can insert whatever information you want. And then I can create a new employee.

Employee ID 134, first name Shai, hire date 2004-03-03, job ID AD_VP, last name Shai, phone number 650-555555. Okay, and salary... And when you click Submit, it actually saves the data. Oh, by the way, if you remember at the beginning of the session, we actually did some business logic that we added to the set last name. So if the last name equals shy, we did something. And you can actually see the results over here at the log window. It actually popped up the message. So the business logic that you created in your model layer was invoked at the correct place, and probably you have a more complex business logic in your application, but it just works. Okay?

And if you want to now edit the details of an employee, just click on the details and you can edit, for example, the last name over here and click and it works. And you can commit the changes or roll back the changes, so let's roll back. Data has disappeared. Okay, so although you did various, you browsed through various pages, moved back and forward using stats, transaction management was completely unharmed and everything was done for you. And this is how we do J2A development in JDeveloper. So visual approach, drag and drop, very easy to do.

What I want to do in the remaining time is I want to try and build a similar application, but this time I'm going to try and use a web service as the data source. So I'm not actually sure if the network connection here to the internet actually works. I'm going to do a find web service on my UDDI repository, and I'm going to look for a web service with the name airport. So what it does now, it basically goes out to actually a Microsoft UDDI repository and looks up all the web services that are on this repository, hopefully finding one that is called airport.

I'm not sure it's actually working here, but I'll try it. And the concept is that just as I created a class to access the database, I can create a class to access the web service. And I then can embed this class into my JDeveloper and use it in my application. I have a feeling that it won't work currently.

probably because of the network setting in here. So you might need to do something else instead. Okay. All right, so let's do something else instead. Instead of showing you how to use an existing web service, let me show you how easy it is to create a web service of your own. So you can create a new application.

Close everything here. And in this new application, let's create a new class. So you choose New, General, Java Class. And let's call this class the, say, High Class. And let's add some method here, so public string. say hello, which actually receives a string variable called name. return hello there from web service plus the name. So this is your hello world example in Java.

Now I want to expose this complex business logic as a web service for other people to use. What I can just do is right-click on the class and I have the ability to create a J2E web service from this class. Once I created this web service, it actually went ahead and created, if you click on the web service here, it created the WSDL for me. So if you know anything about web services, it's an easy way to communicate between processes and functions that are written in any language running on any system. And what I'm basically doing here is I have a web service. WSDL describes what the web service does, which functions it has, which parameters it gets, and this is how I did it. And now I can actually run my web service.

Again, this basically takes the web service and deploys it to the Oracle application server inside my machine. And it gives me a URL for accessing this web service. So let's copy the URL. Open the Safari window. probably change the IP address again to 127.0.0.1. This is a testing harness for my web service. I can invoke the say hello, pass a parameter, Click invoke, and it goes out, invoke the web service, and this is the SOAP message I get back. And just as easy as I did it for a Java class, we can do it for an EJB, for a session bin. We can do it for a PL/SQL stored procedure. So if you have a database code-- you have code inside your database as stored procedure, we can let you expose this code as web services so people can reuse it for a web service interface. So this was another aspect of JDeveloper, the ability to create web services and use them in your application. What else can I show you? Any questions so far?

So if you click on the web service over here, you have the WSDL. It doesn't matter. Over here on the web service, right click and choose Run. This basically takes the WSDL, takes the jar, basically gets the jar file, package everything, and deploys it to the embedded J2E server. On the log window, you'll have a URL that you can copy and paste on your machine. and this would bring up the page to test your web service. And you can try adding more parameters to your web service and try to run it that way.

Yeah, so if I copy this one, pop this up. Place it here. So the way that web services communicate with one another, the way that the client for a web service and a web service communicate with one another, is by using SOAP messages. So you can actually click the Say Hello. This pops up just a screen that knows how to activate your web service.

the parameter and click invoke. It sends a SOAP message over but it also receives a SOAP message in return. And you should see the results of your web service as the return value of your SOAP message. It's not very nice, but it's very powerful, okay? Because this is a way for you to expose functionality you have in your system, okay?

So if you're, for example, a company that produces a utility to create PDF from, I don't know, from Word documents, you can have a web service interface to your utility and expose it. And you can charge people for using the web service. But it's also very powerful in-house. If you have various departments in your organizations doing various things, So the people who develop the HR system might actually have some utilities that can be useful for other people. For example, the ability to look up people's phone number from the HR database, stuff like that. Just expose it as a web service, as easy as that.

Okay. While we're here, I'll show you just a little bit of JDeveloper 10.1.3 just to give you a taste of how it differs from 10.1.2 in terms of look and feel and functionality. In 10.1.3, I'm popping up the preview version that you can currently download from OTN. One of our main focus area was improving coder productivity. So in 10.1.2, you saw how I do everything visually. But when you actually go and you develop a project beyond just doing things visually, at some point you'll have to delve into the code and do some changes. So we wanted to make sure that even those types of changes would be easy to do. So let's create a new application over here. Call it 10.1.3 demo.

Let's create a new class. Let's call this class, that would be my dog class. So one thing you should see out of the box is that the whole user interface has been revised. It includes the way that you can double click a tab to maximize the area so you can see more things. And this works for every area of your screen. So you can click the structure window. You can click the application navigator.

Let's define a couple of variables, like a private string name for the dog, and also a private int age for the dog. Thank you. Okay, let me try and increase the font so you'll be able to see more because this is actually a coding demo. it would be nice for you to be able to see some of the stuff. Thanks.

What you can see now is that the name and age are grayed out. If you compare them, for example, to the string. And if you actually stand on the line, you'll see a little light bulb on the side. And if you click on it, it will tell you this is an unused parameter or unused variable. Do you want to remove it? And you can choose to remove it if you want to. I actually do want to use them, so let's right-click over here and choose "Generate Accessories."

This generates setters and getters for my two parameters and now they are used so they are not grayed out anymore. I can now add another method, for example, which will do public string say hello and... And as you can see, it automatically closed the string for me at the end without any problems. And I can just keep writing and it will do it for me. This is a very good class actually. I can actually use it as an interface for other classes. So what I can do now is I can right click over here and choose refactor and say extract interface. And call this interface the iAnimal interface.

and specify the methods that I want to implement to be part of this interface. And this creates an interface for me and automatically change the code for the dog class to say it implements this interface. And I can actually have a little indicator saying this method is implementing an interface. And if I click any of those methods, I will be taken back to this place. Okay, let's go back. So now I can actually go and say, that's very nice, let's create another class. Let's create the class cat, the cat class.

And let's tell this class that it actually implements an interface. Sorry, I didn't save everything, so I probably should save everything. Tools, implement interface, and add there my apple, my package. I have the animal interface, and everything was generated from it. And then at some point I say, it doesn't make sense for animals to say hello. They don't say hello. So I actually want to rename this method. So I can just right click on it and say refactor rename and say speak, because anyone can speak, of course. So I click speak and I have the preview checked here.

And it actually shows me if I change it in the interface, where else it should be changed. So it should be changed in the cat class as well as in the dog class. And if I'm fine with that, I can just tell it, okay, run ahead and change it. And if you go to the cat class, it now says speak over here. And if you go to the dog class, it says speak over here. And if you find out, actually, this is not what I wanted. I want to go back. You just go and you do undo. and it undoes the changes everywhere for you.

It's very nice. So this is refactoring, which is a very strong way to organize your code. And refactoring is defined as changing the structure of the code without influencing the functionality of the code. And it makes it very easy to break out parts of your code and make it more usable. For example, if say hello actually got a parameter. Suppose I want to have a parameter for this stuff. Hello. Okay. Click over here. And I can say introduce parameter. That's it. That's it.

Instead of woof. Oh yeah, 'cause I'm implementing the interface. Let's remove the implement interface. We don't want to do it. Probably that's a good practice to actually read the error messages when they pop up. Okay, so I don't want to say woof, I wanted to actually get a parameter which is... Hello parameter. And it would automatically replace this thing, this constant that I had here, this thing, with a parameter that I actually get here. And maybe I just, I don't want it to just say hello, I want it to say hello, plus another parameter which is name. So let's do another string name. And actually, if I take those two things, I would like to have... I would like to refactor them into a variable that is called "Greeting".

So now I have a greeting that is consistent of those two. So you see how easy it is to take parts and move it out. Other stuff that you can do is, for example, we have dynamic code templates now. So if you type, for example, a tally and press return enter, you get a loop, an i, and for i loop, that you can actually change. So you can go, I don't want to call it i, I want to call it counter, And then I'm going to run all the way to the dog size. And when you click, it changes everything in the loop for you automatically. And you can define your own templates like this. So there's, for example, the connection stuff that automatically creates a JDBC connection for you in your class. And then maybe you say, "Hey, that's very nice. Maybe I should take..." All right, let's remove this part. Okay.

Maybe I should take this part and just refactor, extract it as its own method. So you can actually take parts of your code and create methods from them so they can become reusable. So refactoring is one of the features over here. Better integration with CVS. JSF support. So if previously we did JSP page editing in JDeveloper 10.1.3, You can also go to the web tier and create JSF pages using a visual JSF page layout editor, as well as a visual way to manage the JSF page flow, or basically the faces config file. And there's a lot of other features in 10.1.3. As I said, it should probably be called 11. And this is, can we switch back to the slides now? - Well, um, This is the demo I wanted to show you. And if you missed anything or if you didn't have your machine ready here to follow with me, you can just go to this URL over here to the JDeveloper homepage on OTN. And there's a link there to something called the ADF Workshop Top Link version. And this basically takes you to the same steps I did on the stage with screenshots and everything in there for you to follow step by step. There are many other tutorials in there. If you want to do more web services stuff, it's also there. That's it. So what should be your next step? Go to otn.rokel.com, download the software, free download, complete version on your machine. Follow the tutorials, demos, white paper, sample extensions. If you have any questions, you can ask them on the discussion forum on OTN. And you might want to join our Java newsletter, a monthly newsletter that goes out to our Java developers, Keeps you up to date on the latest things that we added to the product and the latest how-tos, articles and other stuff. And that's it. Any questions? Friends. So the other URL is basically just go to do a Google search for jDeveloper, click the first link that comes up-- not the add link, but the first link-- and you should be taken to this page. Just go to oracle.com/technology. On the left side, choose jDeveloper.

All right. So if you want to see more about JDeveloper, see other types of development, see JB development, how it's done in JDeveloper, see web services development, see other things, just come down to the data center. We have a JDeveloper booth over there. Thank you very much for joining me today. Hope to see you soon. Thank you.