ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Lesson - 42 : Hibernate - Call Procedure or Function In Hibernate Using CallableStatement of JDBC

hibernate interview questions

hibernate tutorials

hibernate architecture

hibernate mapping

hibernate annotations

hibernate configuration

hibernate criteria

hibernate cascade

hibernate crud

hibernate collection mapping

hibernate envers

hibernate framework

hibernate generator class

hibernate hql

hibernate life cycle

hibernate native sql

hibernate object states

hibernate query language tutorial

hibernate relationships

hibernate session

Автор: Sada Learning Hub

Загружено: 2018-06-13

Просмотров: 358

Описание: Hibernate – Procedure Call Using Callable Statement :
We have two approaches to call procedure or function.
1. If a procedure or a function returns scalar values then it can be called using CallableSatement of jdbc in hibernate.
2. If a procedure or a function returns a cursor object then it can be called using queries concept of hibernate.
Approch-1
If a procedure or a function returns scalar values then it can be called using CallableSatement of jdbc in hibernate.
1. This approach is used when a procedure or function is returning row values or scalar values which means like a number or string or date etc.
2. This approach is added in hibernate from 3.6.5 version onwards.

The following the steps to call a procedure or a function in this approach
1. Create a class byimplementing org.hibernate.jdbc.Work interface.
2. Implement the only one abstract method of work interface called execute().
3. Define the procedure or function call code in execute method.
4. Pass the class object as a parameter to the do work method of session interface.

//step-1
class ProcedureCall implements org.hibernate.jdbc.work
//step2
public void execute(Connection con)throws SQLException
//step3
CallableStatements cstmt = con.preparecall("{call procedure name(?,?,?)}");
cstmt.execute();
//step-4
ProcedureCall pc = new ProcedureCall();
Session.doWork(pc);

//step-1
class ProcedureCall implements org.hibernate.jdbc.work{
//step2
public void execute(Connection con)throws SQLException{
//step3
CallableStatements cstmt = con.preparecall("{call procedure name(?,?,?)}");
cstmt.execute();
}
}

Class Main{
public static void main(String[] args){
ProcedureCall pc = new ProcedureCall();
//step-4
Session.doWork(pc);
}
}

Hibernate Examples Project Github Link : https://github.com/SadaLearningHub1/H...

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Lesson - 42 : Hibernate - Call Procedure or Function In Hibernate Using CallableStatement of JDBC

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]