Methods
[Geek Home] [PC Hints & Tips] [Internet] [Programming] [Nanet Sites]

Open up the EAB again, click on the bean to see your package, and right click on your DAXSession to edit it:

Picture

This now reopens the DAXSession Schema Mapping screen. From there, we want to create an SQL Method on the Section class. Right click on the Section Bean and select Methods.

Picture
Picture

Now a screen like the one shown above, will open. As you can see, it allows you to create a method that calls a stored procedure on your DB2 server, or you can create a customized SQL statement. We are going to select “Add” on the top one to create a customized SQL statement.

The following screen will come forward. First I typed in my SQL statement.

WARNING: DO NOT put ENTERS (carriage returns) after lines as shown below! When you go to save the Schema Mapping, the EAB will CRASH and you will be forced to uninstall and reinstall. I did this 7 times before finding out from technical support that breaking the lines is a bug in this version and would cause a crash.

Picture

 Since I am comparing the “dept_id” to a variable chosen at run-time by the user, I insert a “?” to indicate that I don’t know what it will be. When I validate this statement, all the fields selected will be included in the “Parameters” box. Notice how the first one is “param1.” This was created from my “?.” The system chose the name.

Next you will need to fill in the name you want to give the method. And you’re done. There are several other things you can do on this screen, like adding additional parameters at the bottom. But I’m keeping this simple.

Here is my command using two tables:

select coursename, credithours, coursecomment, section.* from course, section where course.dept_id = ? and section.dept_id = ? and course.coursenum = section.coursenum

Remember, one long line, no CARRIAGE RETURNS!

Picture

Now select “OK” at the bottom. The following screen will return with the new method showing in the list. Select “Close” to return to the DAXSession Schema Mapping.

Picture

Now use the same steps to create a method for the “Dept” bean. This will be your SQL:

select * from dept order by dept_name

Now we’ll see how to specify the URL of the database.

Picture
 Create a Package  Methods  Specify the URL  Export
[Geek Home] [PC Hints & Tips] [Internet] [Programming] [Nanet Sites]

Modified: 02/11/99

Picture