UPDJAVA - USING SQLJ TO WRITE JAVA STORED PROCEDURES Assignment Help

Assignment Help: >> Oracle Internet File System - UPDJAVA - USING SQLJ TO WRITE JAVA STORED PROCEDURES

UPDJAVA - USING SQLJ TO WRITE JAVA STORED PROCEDURES

package modify_emp;
import sqlj.runtime.*;
import sqlj.runtime.ref.*;
public class update_emp  

 {
public static int update_emp (String name, int raise, String location)# function with parameter#
{
int newsal = -1;
String newloc = "UNKNOWN";
try {

# sql {UPDATE emp

SET sal = sal + :raise
WHERE    ename = :name } ;

#sql    {UPDATE emp

SET city = :location
WHERE ename = :name } ;

#sql {SELECT sal INTO :newsal

FROM emp
WHERE ename = :name} ;

#sql {SELECT city INTO :newloc

FROM emp
WHERE ename = :name}    ;
}
catch (Java.sql.SQLException e) { }
return newsal;
}
}

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd