Java’da PL/SQL Fonksiyon Çağırma
6 November 2008 ThursdayAşağıdaki fonksiyon ile bir PL/SQL fonksiyonu Java’dan çağırılabilir;
public static String gorusmeleriAktar() throws Exception{
int ret_code;
String sonuc = null;
CallableStatement pstmt = null;
Connection Baglan = new com.example.dao.Connection().baglan();
try {
pstmt = Baglan.prepareCall("{? = call SCHEME.F_FONK_NAME()}");
pstmt.registerOutParameter(1, Types.VARCHAR);
pstmt.execute();
sonuc = pstmt.getString(1);
} catch (SQLException e) {
ret_code = e.getErrorCode();
System.out.println("HATA:"+ret_code + e.getMessage());
}
if(pstmt!=null) pstmt.close();
if(Baglan!=null) Baglan.close();
return sonuc;
}
Bu yazı ile ilgili yorumları RSS 2.0 adresinden takip edebilirsiniz..
Bu yazıya yorum ekleyebilirsiniz veya kendi web sitenize geri izleme olarak ekleyebilirsiniz.