Thursday, December 2, 2010

Calling SQL Statment Inside Java Code

One of the important way for developing is calling a sql statment inside your java code and I will explain how to do this:
1- call a select statment
asume we want to make a function take department Id and return its name so we will make this function



2- Call an updatable statment as (Create, Insert, Update and Delete)asume we want to make a function take department id and delete it




where getAm() is a method return your Application Module as :




If you want to use java connection (don't want to use AppModule) you can use something like this: