December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to create a database function using the Java language.
Create a function written in Java, and then create a call specification for the function. Ensure that the call specification allows for the same number of parameters to pair up with the Java function and allows for a returning result. For this recipe, you will add a function to the Employees Java class that will accept an employee ID and return that employee's job title. The following code is the Java source for the function named getEmpJobTitle:
public static String getEmpJobTitle(int empId){
String jobTitle = null;
try {
Connection conn = DriverManager. getConnection("jdbc:default:connection:"); ...Read now
Unlock full access