Java web development 10 (draft)
자바 웹 개발 시작하기
(10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)
2012. 1. 18
벌써 2년도 넘은 자료지만
그래도 필요하신분이 있을지 몰라서...
(지금보니 2년사이 많은것을 배운것 같네요 ㅎㅎ)
사실 마지막 주차는 발표자료 마무리가 부족하다.
그 당시 뭔가 급한일이 있어서;;; (일꺼라 추측)
지금와서 문서에 손을 대기는 좀 그래서 부족하지만 수정없이 배포한다.
The document summarizes BuzzNumbers' transition from using SQL Server to MongoDB as their database. It discusses problems they faced with SQL Server like scalability issues and performance problems with large datasets. It then covers why they chose to use MongoDB, including its ability to scale horizontally and handle large volumes of writes and reads. Finally, it discusses lessons learned in moving to a NoSQL database and using MongoDB and .NET to build their analytics product.
The document describes the syntax for creating, altering, and dropping tables in SQL. It provides examples of creating tables with column constraints, default values, primary keys, foreign keys, and unique constraints. It also shows how to add, modify, and drop columns from existing tables using ALTER TABLE statements. The final sections cover DML statements for inserting, updating, deleting, and selecting data from tables.
NoSQL databases only unfold their entire strength when also embracing the their concepts regarding usage and schema design. These slides give some overview of features and concepts of MongoDB.
This document discusses Liquibase, an open source database change management tool. It describes how Liquibase tracks changes to a database schema over time by storing them in changesets within XML changelog files. Each changeset can contain changes like creating/dropping tables, columns, indexes, and more. Changelogs allow splitting changes into multiple files and changesets add metadata like author and preconditions. Liquibase supports rolling back changes and diffing databases to generate changesets. It can be run from the command line or integrated with build tools and applications.
The document discusses best practices for exception handling in Java applications. It recommends that exceptions should only be used for exceptional situations, be properly logged, and result in appropriate error responses. Business exceptions should be thrown for invalid user behavior, while technical exceptions occurring internally should be wrapped in business exceptions. Exceptions should have clear, descriptive names and result in the proper HTTP status codes. The document also provides examples of implementing localized exceptions, handling exceptions globally or at the controller level, and using SLF4J with Logback for logging.
Java web development 10 (draft)
자바 웹 개발 시작하기
(10주차 : ㅌㅗㅇ ㅎㅏ ㄹㅏ)
2012. 1. 18
벌써 2년도 넘은 자료지만
그래도 필요하신분이 있을지 몰라서...
(지금보니 2년사이 많은것을 배운것 같네요 ㅎㅎ)
사실 마지막 주차는 발표자료 마무리가 부족하다.
그 당시 뭔가 급한일이 있어서;;; (일꺼라 추측)
지금와서 문서에 손을 대기는 좀 그래서 부족하지만 수정없이 배포한다.
The document summarizes BuzzNumbers' transition from using SQL Server to MongoDB as their database. It discusses problems they faced with SQL Server like scalability issues and performance problems with large datasets. It then covers why they chose to use MongoDB, including its ability to scale horizontally and handle large volumes of writes and reads. Finally, it discusses lessons learned in moving to a NoSQL database and using MongoDB and .NET to build their analytics product.
The document describes the syntax for creating, altering, and dropping tables in SQL. It provides examples of creating tables with column constraints, default values, primary keys, foreign keys, and unique constraints. It also shows how to add, modify, and drop columns from existing tables using ALTER TABLE statements. The final sections cover DML statements for inserting, updating, deleting, and selecting data from tables.
NoSQL databases only unfold their entire strength when also embracing the their concepts regarding usage and schema design. These slides give some overview of features and concepts of MongoDB.
This document discusses Liquibase, an open source database change management tool. It describes how Liquibase tracks changes to a database schema over time by storing them in changesets within XML changelog files. Each changeset can contain changes like creating/dropping tables, columns, indexes, and more. Changelogs allow splitting changes into multiple files and changesets add metadata like author and preconditions. Liquibase supports rolling back changes and diffing databases to generate changesets. It can be run from the command line or integrated with build tools and applications.
The document discusses best practices for exception handling in Java applications. It recommends that exceptions should only be used for exceptional situations, be properly logged, and result in appropriate error responses. Business exceptions should be thrown for invalid user behavior, while technical exceptions occurring internally should be wrapped in business exceptions. Exceptions should have clear, descriptive names and result in the proper HTTP status codes. The document also provides examples of implementing localized exceptions, handling exceptions globally or at the controller level, and using SLF4J with Logback for logging.
The document discusses REST API design principles and best practices. It begins by providing examples of RESTful API requests and responses. It then covers REST concepts like resources, verbs, hypermedia, content negotiation, and representation formats. The document advocates for designing APIs that are self-documenting through hypermedia and embedding links to allow discovery of available state transitions and actions. It also discusses balancing REST purism with pragmatic design choices and notes that many popular APIs are not purely RESTful but are still well-designed.
This document provides an overview of working with databases and MySQL. It discusses database concepts like tables, records, fields, primary keys, and relationships. It also covers MySQL topics such as creating and selecting databases, defining tables, adding/retrieving/updating/deleting records, and modifying user privileges. The goal is to teach the basics of working with databases and the MySQL database management system.
Low Code Integration with Apache Camel.pdfClaus Ibsen
Design your integration flows using Camel and JBang for a better developer experience, and make it easily production grade using Quarkus.
Claus Ibsen, Apache Camel lead & Senior Principal Software Engineer, Red Hat
Modern Java web applications with Spring Boot and ThymeleafLAY Leangsros
If you’re using Java in an enterprise environment, you’ve most likely been using Spring Framework with JSP which does the job pretty well.But I will provide the sampling of how Spring Boot helps you accelerate and facilitate application development better. I will show a templating technology, Thymleaf which can be used much more modern features;
JSON-LD is a set of W3C standards track specifications for representing Linked Data in JSON. It is fully compatible with the RDF data model, but allows developers to work with data entirely within JSON.
More information on JSON-LD can be found at http://json-ld.org/
This developer-focused webinar will explain how to use the Cypher graph query language. Cypher, a query language designed specifically for graphs, allows for expressing complex graph patterns using simple ASCII art-like notation and offers a simple but expressive approach for working with graph data.
During this webinar you'll learn:
-Basic Cypher syntax
-How to construct graph patterns using Cypher
-Querying existing data
-Data import with Cypher
-Using aggregations such as statistical functions
-Extending the power of Cypher using procedures and functions
MySql Triggers Tutorial - The Webs Academythewebsacademy
A SQL trigger is a set of SQL statements stored in the database catalog. A SQL trigger is executed or fired whenever an event associated with a table occurs e.g., insert, update or delete.
This document provides an overview of MongoDB for Java developers. It discusses what MongoDB is, how it compares to relational databases, common use cases, data modeling approaches, CRUD operations, indexing, aggregation, replication, sharding, and tools for integrating MongoDB with Java applications. The document contains multiple code examples and concludes with a demonstration of building a sample app with MongoDB.
Indexes are data structures that enable fast searching of data in database tables. There are different types of indexes including B-tree, bitmap, and function-based indexes. Indexes can be unique or non-unique. Index-organized tables store data in an index structure based on the primary key, while heap-organized tables store data separately from indexes and access rows using row IDs. Proper use of indexes can improve query performance.
The document discusses HTTP requests and responses. It explains that a request contains a start line with the method, URL and HTTP version, followed by headers providing additional information, and an optional message body. A response contains a status line with the protocol version and status code, followed by headers including caching information, and an optional message body. Content negotiation headers like Accept and Content-Type are used to select the appropriate representation format.
This document provides an overview of AngularJS, including its features, directives, filters, data binding, views, controllers, modules, and factories. It discusses key AngularJS concepts like single page applications, directives like ng-repeat and ng-model, filters, creating controllers within modules, and using factories. It also covers creating custom directives, dependency injection with $inject, and the differences between values, services, factories and providers in AngularJS.
1. The document discusses microservices architecture and how Netflix transitioned from a monolithic architecture to microservices. Key aspects discussed include breaking the monolith into many small, independent services that are loosely coupled.
2. Netflix's microservices architecture is composed of hundreds of microservices running on thousands of servers. Each service focuses on doing a small, well-defined piece of work. Services communicate through well-defined APIs and share no code or databases.
3. The document provides examples of how other companies like Samsung and Vingle have also adopted microservices architectures on AWS, breaking monolithic applications into independent, scalable services. This allows for independent deployments, rapid innovation, and improved resilience.
This document discusses document databases and schema design when modeling data. It introduces key concepts like embedding related data within documents for optimal performance and flexibility compared to traditional relational schemas. Examples are provided for how to model one-to-one, one-to-many, and many-to-many relationships either through embedding or referencing other documents. General recommendations suggest embedding by default for relationships where related data is often accessed together, while referencing may be better for scaling or inconsistent many-to-many relationships. The goal is to design schemas that match how the application will use the data for best results.
The document discusses migrating from an RDBMS to MongoDB. It covers determining if a migration is worthwhile based on evaluating current pain points and target value. It also discusses the roles and responsibilities that will change during a migration, including data architects, developers, DBAs and more. Bulk migration techniques are reviewed including using mongoimport to import JSON data. System cutover is also mentioned as an important part of the migration process.
Laravel, längst kein unbestriebenes Blatt mehr, gewinnt immer mehr an Popularität.
In diesem Vortrag wir Laravel kurz vorgestellt mit Themen wie:
- Was ist Laravel?
- Woher kommt Laravel?
- Was bietet Laravel?
- Laravel und sein Ecosystem.
und einiges mehr...
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...Edureka!
( ** Full Stack Masters Training: https://www.edureka.co/masters-program/full-stack-developer-training ** )
This PPT on jQuery will help you understand the basics of jQuery and you will also be able to create your own program using jQuery by the end of this PPT.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Net-a-Porter has embarked on the mission of separating database refactoring from code deployment. The solution we've come up with is "refactoring as a service" and a soon-to-be released Perl module which drives it.
I'll explain how Liquibase, our Git repositories, Puppet and Jenkins all fit together to make database refactoring easy and deployment safe and roll-backable.
I'll also tell you how I just discovered Sqitch as a possible replacement for Liquibase.
... and all within 20 minutes!
Bullying is a serious problem that negatively impacts many students. It involves unwanted aggressive behavior that is repeated over time and involves an imbalance of power or strength. Schools must establish a zero-tolerance policy for bullying and empower students to look out for one another.
The document outlines the five main types of business entities - sole proprietorship, partnership, corporation, S corporation, and limited liability company - and discusses the key tax requirements and considerations for each. It also provides an overview of important initial steps like obtaining an employer identification number, maintaining proper recordkeeping, and choosing an accounting method and tax year for the business.
The document discusses REST API design principles and best practices. It begins by providing examples of RESTful API requests and responses. It then covers REST concepts like resources, verbs, hypermedia, content negotiation, and representation formats. The document advocates for designing APIs that are self-documenting through hypermedia and embedding links to allow discovery of available state transitions and actions. It also discusses balancing REST purism with pragmatic design choices and notes that many popular APIs are not purely RESTful but are still well-designed.
This document provides an overview of working with databases and MySQL. It discusses database concepts like tables, records, fields, primary keys, and relationships. It also covers MySQL topics such as creating and selecting databases, defining tables, adding/retrieving/updating/deleting records, and modifying user privileges. The goal is to teach the basics of working with databases and the MySQL database management system.
Low Code Integration with Apache Camel.pdfClaus Ibsen
Design your integration flows using Camel and JBang for a better developer experience, and make it easily production grade using Quarkus.
Claus Ibsen, Apache Camel lead & Senior Principal Software Engineer, Red Hat
Modern Java web applications with Spring Boot and ThymeleafLAY Leangsros
If you’re using Java in an enterprise environment, you’ve most likely been using Spring Framework with JSP which does the job pretty well.But I will provide the sampling of how Spring Boot helps you accelerate and facilitate application development better. I will show a templating technology, Thymleaf which can be used much more modern features;
JSON-LD is a set of W3C standards track specifications for representing Linked Data in JSON. It is fully compatible with the RDF data model, but allows developers to work with data entirely within JSON.
More information on JSON-LD can be found at http://json-ld.org/
This developer-focused webinar will explain how to use the Cypher graph query language. Cypher, a query language designed specifically for graphs, allows for expressing complex graph patterns using simple ASCII art-like notation and offers a simple but expressive approach for working with graph data.
During this webinar you'll learn:
-Basic Cypher syntax
-How to construct graph patterns using Cypher
-Querying existing data
-Data import with Cypher
-Using aggregations such as statistical functions
-Extending the power of Cypher using procedures and functions
MySql Triggers Tutorial - The Webs Academythewebsacademy
A SQL trigger is a set of SQL statements stored in the database catalog. A SQL trigger is executed or fired whenever an event associated with a table occurs e.g., insert, update or delete.
This document provides an overview of MongoDB for Java developers. It discusses what MongoDB is, how it compares to relational databases, common use cases, data modeling approaches, CRUD operations, indexing, aggregation, replication, sharding, and tools for integrating MongoDB with Java applications. The document contains multiple code examples and concludes with a demonstration of building a sample app with MongoDB.
Indexes are data structures that enable fast searching of data in database tables. There are different types of indexes including B-tree, bitmap, and function-based indexes. Indexes can be unique or non-unique. Index-organized tables store data in an index structure based on the primary key, while heap-organized tables store data separately from indexes and access rows using row IDs. Proper use of indexes can improve query performance.
The document discusses HTTP requests and responses. It explains that a request contains a start line with the method, URL and HTTP version, followed by headers providing additional information, and an optional message body. A response contains a status line with the protocol version and status code, followed by headers including caching information, and an optional message body. Content negotiation headers like Accept and Content-Type are used to select the appropriate representation format.
This document provides an overview of AngularJS, including its features, directives, filters, data binding, views, controllers, modules, and factories. It discusses key AngularJS concepts like single page applications, directives like ng-repeat and ng-model, filters, creating controllers within modules, and using factories. It also covers creating custom directives, dependency injection with $inject, and the differences between values, services, factories and providers in AngularJS.
1. The document discusses microservices architecture and how Netflix transitioned from a monolithic architecture to microservices. Key aspects discussed include breaking the monolith into many small, independent services that are loosely coupled.
2. Netflix's microservices architecture is composed of hundreds of microservices running on thousands of servers. Each service focuses on doing a small, well-defined piece of work. Services communicate through well-defined APIs and share no code or databases.
3. The document provides examples of how other companies like Samsung and Vingle have also adopted microservices architectures on AWS, breaking monolithic applications into independent, scalable services. This allows for independent deployments, rapid innovation, and improved resilience.
This document discusses document databases and schema design when modeling data. It introduces key concepts like embedding related data within documents for optimal performance and flexibility compared to traditional relational schemas. Examples are provided for how to model one-to-one, one-to-many, and many-to-many relationships either through embedding or referencing other documents. General recommendations suggest embedding by default for relationships where related data is often accessed together, while referencing may be better for scaling or inconsistent many-to-many relationships. The goal is to design schemas that match how the application will use the data for best results.
The document discusses migrating from an RDBMS to MongoDB. It covers determining if a migration is worthwhile based on evaluating current pain points and target value. It also discusses the roles and responsibilities that will change during a migration, including data architects, developers, DBAs and more. Bulk migration techniques are reviewed including using mongoimport to import JSON data. System cutover is also mentioned as an important part of the migration process.
Laravel, längst kein unbestriebenes Blatt mehr, gewinnt immer mehr an Popularität.
In diesem Vortrag wir Laravel kurz vorgestellt mit Themen wie:
- Was ist Laravel?
- Woher kommt Laravel?
- Was bietet Laravel?
- Laravel und sein Ecosystem.
und einiges mehr...
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
jQuery Tutorial For Beginners | Developing User Interface (UI) Using jQuery |...Edureka!
( ** Full Stack Masters Training: https://www.edureka.co/masters-program/full-stack-developer-training ** )
This PPT on jQuery will help you understand the basics of jQuery and you will also be able to create your own program using jQuery by the end of this PPT.
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Net-a-Porter has embarked on the mission of separating database refactoring from code deployment. The solution we've come up with is "refactoring as a service" and a soon-to-be released Perl module which drives it.
I'll explain how Liquibase, our Git repositories, Puppet and Jenkins all fit together to make database refactoring easy and deployment safe and roll-backable.
I'll also tell you how I just discovered Sqitch as a possible replacement for Liquibase.
... and all within 20 minutes!
Bullying is a serious problem that negatively impacts many students. It involves unwanted aggressive behavior that is repeated over time and involves an imbalance of power or strength. Schools must establish a zero-tolerance policy for bullying and empower students to look out for one another.
The document outlines the five main types of business entities - sole proprietorship, partnership, corporation, S corporation, and limited liability company - and discusses the key tax requirements and considerations for each. It also provides an overview of important initial steps like obtaining an employer identification number, maintaining proper recordkeeping, and choosing an accounting method and tax year for the business.
This document summarizes a study that reexamines the impact of merger accounting methods on market reaction. The study finds:
1) Tax-free mergers using the purchase method exhibited significant positive abnormal returns over the period studied, consistent with prior research. These returns appear to originate in the period before the announcement.
2) Other variables not included in capital asset pricing models do not influence these results.
3) Tests found indirect cash flow effects, like leverage and income manipulation, were associated with the accounting method used, providing a partial explanation for abnormal returns in purchase method mergers.
This document provides an overview of Resorts360, a travel club membership offering luxury destinations, car rentals, cruises and tours at discounted prices for members. It allows members to save on travel and also provides an opportunity to earn income by referring other members. The overview describes the travel benefits for members, including savings of thousands on holidays. It outlines four membership levels ranging from $795 to $9995 annually that provide different income potential from commissions on personal and team sales. The goal is to use marketing tools to invite people to learn more and welcome new members. Testimonials from existing members are provided about savings and income earned.
RFID technology allows wireless identification of objects using radio waves. An RFID system consists of RFID tags attached to objects, readers that can identify tags, and software to process tag data. Tags contain information like serial numbers that is transmitted to readers when in range. Common applications include access control, asset tracking, supply chain management and electronic toll collection. A survey found respondents saw potential RFID applications in inventory control, document management, security, and library management. Further development opportunities exist in medical and library uses of RFID. While bringing convenience, RFID has higher costs than barcodes and standards are still being developed.
PERAWATAN RESTORATIF UNTUK MENCEGAH GAGAL-PULIH PADA LANJUT USIA DI MASYARAKATBondan Palestin
Intervensi kesehatan dan keperawatan dalam bentuk latihan fungsional serta dukungan lingkungan yang positif bagi lanjut usia dapat memelihara kapasitas fungsional dan kualitas hidup lanjut usia. , , , Latihan fungsional dengan intensitas sedang dapat meningkatkan kualitas hidup, vitalitas, dan menurunkan gejala depresi pada lanjut usia secara efektif. Menurut penelitian, program latihan berjalan, mobilitas, dan keseimbangan fleksibel dan statis selama enam minggu dapat meningkatkan kapasitas fungsional lanjut usia. Bentuk program latihan yang memiliki daya ungkit cukup besar terhadap penurunan sindroma gagal-pulih pada lanjut usia adalah perawatan restoratif. Perawatan restoratif merupakan salah satu strategi utama dalam mengatasi sindroma gagal-pulih untuk meningkatkan luaran status kesehatan klien, dan merupakan bentuk intervensi keperawatan yang paling efektif saat ini untuk meningkatkan otonomi dan kemandirian klien.
Merawat usila dalam keluarga tidak terlepas dari latar belakang budaya masyarakat Indonesia yang masih memegang teguh nilai agama dan norma budaya. Masyarakat Indonesia masih menganggap mengasuh usila merupakan wujud balas budi dari masing-masing anggota keluarga kepada orangtuanya ( , ). Oleh karenanya, anggota keluarga harus mampu memahami apa dan bagaimana cara memperlakukan usila dalam kondisi keterbatasannya. Keluarga harus dapat mengerti dan memahami kebutuhan usila baik dalam aspek kesehatan maupun psikologis sehingga usila mampu menjalani masa tuanya secara produktif.
Linux es un sistema operativo de código abierto creado por Linus Torvalds en 1991. Comenzó como un núcleo de Unix y desde entonces ha evolucionado para admitir una amplia gama de aplicaciones, desde servidores hasta dispositivos embebidos. Linux se distribuye bajo varias licencias de código abierto y es ampliamente utilizado en todo el mundo tanto para uso personal como empresarial.
Linux es un sistema operativo de código abierto creado por Linus Torvalds en 1991. Comenzó como un núcleo de Unix y desde entonces ha evolucionado para admitir una amplia gama de hardware y software, con miles de distribuciones desarrolladas por comunidades de usuarios y empresas. Linux se ha convertido en una alternativa popular y gratuita a otros sistemas operativos propietarios.
Seminar ini membahas asuhan keperawatan pada keluarga dengan gangguan anoreksia nervosa. Anoreksia nervosa adalah gangguan mental serius yang terkait dengan morbiditas dan mortalitas tinggi. Penderita anoreksia memiliki ketakutan yang berlebihan untuk menjadi gemuk dan menolak untuk mempertahankan berat badan normal. Gangguan ini dapat menyebabkan berbagai komplikasi kesehatan serius. Asuhan keperawatan keluarga bertujuan m
06 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Metode penelitian ini menggunakan desain potong lintang untuk mengukur variabel-variabel penelitian pada lansia di dua panti werdha. Sampel sebanyak 70 responden dipilih berdasarkan kriteria umur minimal 60 tahun dan tidak sakit parah. Penelitian ini menggunakan alat ukur skor depresi, demensia dan karakteristik responden untuk mengumpulkan data selama 16 minggu dengan memperhatikan etika penelitian.
05 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Penelitian ini berusaha mengukur pengaruh faktor umur, depresi, dan demensia terhadap disabilitas fungsional lansia. Variabel bebasnya adalah ketiga faktor tersebut, sedangkan variabel terikatnya adalah disabilitas fungsional. Diajukan hipotesis bahwa ketiga faktor bebas berhubungan dan berpengaruh terhadap disabilitas fungsional. Definisi operasional dan cara pengukurannya pun dijelaskan.
02 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Kelompok lansia dipandang sebagai kelompok masyarakat yang berisiko (population at risk) mengalami gangguan kesehatan. Oleh karenanya, kelompok lansia merupakan kelompok risiko tinggi yang menjadi perhatian utama dalam cabang ilmu keperawatan komunitas. Masalah keperawatan yang menonjol pada kelompok tersebut adalah meningkatnya disabilitas fungsional fisik sebagai dampak dari respon lansia terhadap proses penuaan, penyakit kronis, atau status psikososialnya.
Disabilitas fungsional lansia sebagai efek dari perubahan fisiologis (umur depresi dan demensia) memungkinkan untuk dijelaskan melalui Model Sistem Neuman (MSN). Mengingat MSN memiliki banyak interrelasi konsep sehingga derivasi teori konseptual tersebut lebih bersifat kontekstual. Oleh karenanya, peneliti bermaksud agar penelitian ini dapat digunakan sebagai studi pendahuluan terhadap penelitian-penelitian mengenai disabilitas fungsional yang lebih kompleks. Gigliotti (2003) berpendapat bahwa kredibilitas MSN hanya dapat dikembangkan melalui proses derivasi dan pengujian teori antara (middle-range theory) sebagai derivat dari MSN.
08 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Berdasarkan analisis statistik, ketiga variabel bebas (umur, depresi, dan demensia) secara bersama-sama dan individu mempengaruhi tingkat disabilitas fungsional pada lansia. Semakin lanjut usia, skor depresi, dan beratnya demensia, semakin tinggi pula tingkat disabilitas yang dialami."
09 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Kelompok lansia dipandang sebagai kelompok masyarakat yang berisiko (population at risk) mengalami gangguan kesehatan. Oleh karenanya, kelompok lansia merupakan kelompok risiko tinggi yang menjadi perhatian utama dalam cabang ilmu keperawatan komunitas. Masalah keperawatan yang menonjol pada kelompok tersebut adalah meningkatnya disabilitas fungsional fisik sebagai dampak dari respon lansia terhadap proses penuaan, penyakit kronis, atau status psikososialnya.
Disabilitas fungsional lansia sebagai efek dari perubahan fisiologis (umur depresi dan demensia) memungkinkan untuk dijelaskan melalui Model Sistem Neuman (MSN). Mengingat MSN memiliki banyak interrelasi konsep sehingga derivasi teori konseptual tersebut lebih bersifat kontekstual. Oleh karenanya, peneliti bermaksud agar penelitian ini dapat digunakan sebagai studi pendahuluan terhadap penelitian-penelitian mengenai disabilitas fungsional yang lebih kompleks. Gigliotti (2003) berpendapat bahwa kredibilitas MSN hanya dapat dikembangkan melalui proses derivasi dan pengujian teori antara (middle-range theory) sebagai derivat dari MSN.
01 TESIS PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL ...Bondan Palestin
Kelompok lansia dipandang sebagai kelompok masyarakat yang berisiko (population at risk) mengalami gangguan kesehatan. Oleh karenanya, kelompok lansia merupakan kelompok risiko tinggi yang menjadi perhatian utama dalam cabang ilmu keperawatan komunitas. Masalah keperawatan yang menonjol pada kelompok tersebut adalah meningkatnya disabilitas fungsional fisik sebagai dampak dari respon lansia terhadap proses penuaan, penyakit kronis, atau status psikososialnya.
Disabilitas fungsional lansia sebagai efek dari perubahan fisiologis (umur depresi dan demensia) memungkinkan untuk dijelaskan melalui Model Sistem Neuman (MSN). Mengingat MSN memiliki banyak interrelasi konsep sehingga derivasi teori konseptual tersebut lebih bersifat kontekstual. Oleh karenanya, peneliti bermaksud agar penelitian ini dapat digunakan sebagai studi pendahuluan terhadap penelitian-penelitian mengenai disabilitas fungsional yang lebih kompleks. Gigliotti (2003) berpendapat bahwa kredibilitas MSN hanya dapat dikembangkan melalui proses derivasi dan pengujian teori antara (middle-range theory) sebagai derivat dari MSN.
PENGARUH UMUR, DEPRESI DAN DEMENSIA TERHADAP DISABILITAS FUNGSIONAL LANSIA DI...Bondan Palestin
Kombinasi umur, depresi, dan demensia berpengaruh signifikan terhadap disabilitas fungsional lansia. Penelitian ini menunjukkan hubungan antara faktor-faktor tersebut dengan tingkat disabilitas yang diukur."
탑크리에듀교육센터(www.topcredu.co.kr)제공
15번째 스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)자료입니다.
Spring JDBC에서 DB 접근하는 방법, Spring JDBC에서 DB 접근하는 방법 – jdbcTemplate, Maven, Gradle에서 오라클 설정에 대해 설명한 자료이니 많은 참고 바랍니다.
탑크리에듀교육센터(www.topcredu.co.kr)제공
스프링프레임워크 & 마이바티스(Spring Framework, MyBatis)
17번째 자료입니다. 참고하시어 많은 도움되셨길 바랍니다.
교육 및 수강문의/기타문의사항은 홈페이지(www.topcredu.co.kr)를 통하여 하실 수 있습니다.^^
스프링군살없이세팅하기(The way to setting the Spring framework for web.)EunChul Shin
깔끔하게 스프링 프레임워크 세팅하는 것에 대한 이야기 입니다.
군살없이 프레임워크를 세팅한다는 의미와 이유, 그리고 스프링 기본 설정 및 설정들의 역할에 대해서 정리해 보았습니다.
This presentation is about Spring framework.
I want to talk about the way to setting the spring framework as tidy in this presentation.
제 14회 한국 자바 개발자 컨퍼런스의 커뮤니티 세션에서 공유한 `overview of spring4` 의 발표 자료
스프링 프레임워크는 2004년에 출시된 이후 지금까지 많은 변화를 겪어왔습니다. 기억에 남아 있는 굴직한 변화를 더듬어 보면 버전 2.0은 XML 네임스페이스와 AspectJ 지원, 버전 2.5부터 애노테이션을 활용한 프로그래밍 기능이 추가되었습니다. 그리고 버전 3.0으로 올라가며 Java 5+ 기반으로 코드 구조가 바뀌고 자바 코드 기반 설정 기능이 추가되었습니다. 2013년 12월 13일에 버전 4.0 발표이 발표되었습니다. 주목할 변화는 바로 Java 8 지원과 제거 대상(@Deprecated)으로 선언되었던 많은 클래스와 메소드들이 삭제되었다는 것입니다. 이 외에도 많은 변화가 있습니다. 이번 시간에는 조금 높은 곳에서 내려다보는 느낌으로 무엇이 추가되었고, 어떤게 바뀌었는지 살펴보려고 합니다.
예제코드 : https://github.com/arawn/overview-of-spring4
1. 한국 스프링 사용자 모임 (http://ksug.org) 1
Refactoring JDBC programming
2008.10.12
박찬욱
2. 한국 스프링 사용자 모임 (http://ksug.org) 2
1. Hand-made JdbcTemplate
1.1 문제 인식 공유
1.2 해결 방안 모색
1.3 Refactoring with Strategy pattern
2. Spring JdbcTemplate
2.1 Best Practice of JDBC Strategy
2.2 Simplify JDBC operation
Table of Contents
3. 한국 스프링 사용자 모임 (http://ksug.org) 3
오늘의 목표는 ?
• Composition + interface-based 프로그
래밍 기법
Spring JdbcTemplate 이해하기
어디 쓸 만한 곳이 없을까 ?
4. 4한국 스프링 사용자 모임 (http://ksug.org)
1. Hand-made JdbcTemplate
5. 한국 스프링 사용자 모임 (http://ksug.org) 5
1.1 문제 인식 공유
• 퀴즈
– iBatis
– ORM(Hibernate or TopLink 등 )
– 내부 추상화 프레임웍
– 쌩 (pure) JDBC~?
6. 한국 스프링 사용자 모임 (http://ksug.org) 6
1.1 문제 인식 공유
• JDBC 근본적인 문제
– TCFTC
• Try-Catch-Finally-Try-Catch
• 최고의 boilerplate 코드
– Connection / Resource 누수 문제
– SQLException
• 데이터베이스 벤더 별로 정의된 error code, error state 정보
Connection con = null;
Statement stmt = null;
try {
con = dataSource.getConnection();
stmt = con.createStatement();
stmt.executeUpdate(“UPDATE TABLE_NAME SET...”);
}catch(SQLException e){
// 예외 처리 ...
}finally {
if (stmt != null) { try { stmt.close(); } catch (SQLException ex) {} }
if (con != null) try { con.close(); } catch (SQLException ex) { }
}
7. 한국 스프링 사용자 모임 (http://ksug.org) 7
1.1 문제 인식 공유
• 전혀 OO 스럽지 않은 반복적인 코드 (boilerplate code) 의 사용
으로 Data Access 코드가 드러워져 간다
“Bad Java code is bad J2EE code.”
- Rod Johnson
8. 한국 스프링 사용자 모임 (http://ksug.org) 8
1.2 해결 방안 모색
Strategy
pattern 을
도입해서
문제 해결
시도
9. 한국 스프링 사용자 모임 (http://ksug.org) 9
1.2 해결 방안 모색
• Strategy pattern 이란 ?
– 실행 시점에 (at runtime) 알고리즘을 선택할 수 있는 방
법
10. 한국 스프링 사용자 모임 (http://ksug.org) 10
1.2 해결 방안 모색
• 왜 Strategy pattern 을 택했나 ?
- Programming to Interface instead of Concrete Class
(Achieving Loose Coupling with Interface)
- Favor object composition over class inheritance
(Prefer Object Composition to Concrete Inheritance)
11. 한국 스프링 사용자 모임 (http://ksug.org) 11
2.1 Best Practice of JDBC Strategy
• Strategy pattern
참조 : wiki[2]
12. 한국 스프링 사용자 모임 (http://ksug.org) 12
1.3 Refactoring with Strategy pattern
• 변경되는 부분과 그렇지 않은 부분 식별하기 , 각각
– Updating sql 실행
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
"update LECTURE SET name=? where ID=?“
);
// binding sql parameter
stmt.setString(1, name);
//...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
"insert into LECTURE values(?, ?, ?, ?, ?)“
);
// binding sql parameters
stmt.setInt(1, incrementer.nextIntValue());
// ...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
update() insert()
13. 한국 스프링 사용자 모임 (http://ksug.org) 13
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
"update LECTURE SET name=? where ID=?“
);
// binding sql parameter
stmt.setString(1, name);
//...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
메소드 인자로 빼
냄
콜백 메소드로 구
현
공통 메소드로 추출
update()
insert()
14. 한국 스프링 사용자 모임 (http://ksug.org) 14
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
"update LECTURE SET name=? where ID=?“
);
// binding sql parameter
stmt.setString(1, name);
//...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
update()
insert()
15. 한국 스프링 사용자 모임 (http://ksug.org) 15
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
"update LECTURE SET name=? where ID=?“
);
// binding sql parameter
stmt.setString(1, name);
//...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
update()
16. 한국 스프링 사용자 모임 (http://ksug.org) 16
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
stmt = con.prepareStatement(
" insert into LECTURE values(?, ?, ?, ?, ?)“
);
// binding sql parameter
stmt.setString(1, name);
//...
// execute Query
result = stmt.executeUpdate();
} catch (SQLException exception) {
// 예외처리
} finally {
if (stmt != null) {
try {stmt.close();}catch(SQLException e){}
}// end if
if (con != null) {
try {con.close();}catch(SQLException e){}
}// end if
}// end try-catch-finally
return result;
insert()
17. 한국 스프링 사용자 모임 (http://ksug.org) 17
1.3 Refactoring with Strategy pattern
• Strategy pattern 이 적용된 Template.update()
18. 한국 스프링 사용자 모임 (http://ksug.org) 18
1.3 Refactoring with Strategy pattern
• 변경되는 부분과 그렇지 않은 부분 식별하기 , 각각
– querying sql 실행
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE where ID=?“
);
// binding sql parameter
stmt.setInt(1, id);
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
result = new Lecture();
Result.setName(rs.getString(2));
// extracting...
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE“
);
// binding sql parameter
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
lecture = new Lecture();
Result.setName(rs.getString(2));
// extracting...
result.add(lecture);
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
get() getall()
19. 한국 스프링 사용자 모임 (http://ksug.org) 19
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE where ID=?“
);
// binding sql parameter
stmt.setInt(1, id);
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
result = new Lecture();
Result.setName(rs.getString(2));
// extracting...
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
get()
메소드 인자로 빼
냄
콜백 메소드로 구
현
공통 메소드로 추출
getall()
20. 한국 스프링 사용자 모임 (http://ksug.org) 20
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE where ID=?“
);
// binding sql parameter
stmt.setInt(1, id);
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
result = new Lecture();
Result.setName(rs.getString(2));
// extracting...
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
get()
getall()
21. 한국 스프링 사용자 모임 (http://ksug.org) 21
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE where ID=?“
);
// binding sql parameter
stmt.setInt(1, id);
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
result = new Lecture();
Result.setName(rs.getString(2));
// extracting...
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
getall()
22. 한국 스프링 사용자 모임 (http://ksug.org) 22
1.3 Refactoring with Strategy pattern
try {
// get DB connection
con = getConnection();
// create Statement
rs = con.prepareStatement(
“select * from LECTURE where ID=?“
);
// binding sql parameter
stmt.setInt(1, id);
// execute Query
rs = stmt.executeQuery();
//extract result
while (rs.next()) {
result = new Lecture();
Result.setName(rs.getString(2));
// extracting...
}
} catch (SQLException exception) {
// 예외처리
} finally {
// 자원 반환 처리
}
return result;
get()
23. 한국 스프링 사용자 모임 (http://ksug.org) 23
1.3 Refactoring with Strategy pattern
• Strategy pattern 이 적용된 Template.query()
24. 한국 스프링 사용자 모임 (http://ksug.org) 24
1.3 Refactoring with Strategy pattern
• Refactoring 1.
– 결과 값의 타입은 ?
– ResultSet 처리
• 동일한 DTO 인 경우 , 거의 동일하게 ResultSet 에서 값을 빼내는
코드가 반복됨
return (Lecture) template.query(
"select * from LECTURE where ID=?",
...
}, new ResultSetExtractor() {
public Object extractResult(ResultSet rs)
throws SQLException {
// extract result to Single Object
Lecture result = new Lecture();
while (rs.next()) {
result.setId(rs.getInt(1));
result.setName(rs.getString(2));
result.setSpeaker(rs.getString(3));
}
return result;
}
});
return (List<Lecture>) template.query(
"select * from LECTURE",
...
}, new ResultSetExtractor() {
public Object extractResult(ResultSet rs)
throws SQLException {
// extract result to Collection Object
List<Lecture> result =
new ArrayList<Lecture>();
while (rs.next()) {
Lecture lecture = new Lecture();
lecture.setId(rs.getInt(1));
lecture.setName(rs.getString(2));
lecture.setSpeaker(rs.getString(3));
result.add(lecture);
}
return result;
}
});
get() getall()
25. 한국 스프링 사용자 모임 (http://ksug.org) 25
1.3 Refactoring with Strategy pattern
return (Lecture) template.query(
"select * from LECTURE where ID=?",
...
}, new ResultSetExtractor() {
public Object extractResult(ResultSet rs)
throws SQLException {
// extract result to Single Object
Lecture result = new Lecture();
while (rs.next()) {
result.setId(rs.getInt(1));
result.setName(rs.getString(2));
result.setSpeaker(rs.getString(3));
}
return result;
}
});
get()
콜백 메소드로 구현
API 로 구분
26. 한국 스프링 사용자 모임 (http://ksug.org) 26
1.3 Refactoring with Strategy pattern
return (Lecture) template.query(
"select * from LECTURE where ID=?",
...
}, new ResultSetExtractor() {
public Object extractResult(ResultSet rs)
throws SQLException {
// extract result to Single Object
Lecture result = new Lecture();
while (rs.next()) {
result.setId(rs.getInt(1));
result.setName(rs.getString(2));
result.setSpeaker(rs.getString(3));
}
return result;
}
});
get()
27. 한국 스프링 사용자 모임 (http://ksug.org) 27
1.3 Refactoring with Strategy pattern
return (Lecture) template.query(
"select * from LECTURE where ID=?",
...
}, new ResultSetExtractor() {
public Object extractResult(ResultSet rs)
throws SQLException {
// extract result to Single Object
Lecture result = new Lecture();
while (rs.next()) {
result.setId(rs.getInt(1));
result.setName(rs.getString(2));
result.setSpeaker(rs.getString(3));
}
return result;
}
});
get()
28. 한국 스프링 사용자 모임 (http://ksug.org) 28
1.3 Refactoring with Strategy pattern
• Refactoring 2.
– 여전히 Template 의 query() 와 update() 에서 JDBC API
가 중복되어 사용된다 !
29. 한국 스프링 사용자 모임 (http://ksug.org) 29
1.3 Refactoring with Strategy pattern
• Refactoring 2. 결과
30. 한국 스프링 사용자 모임 (http://ksug.org) 30
1.3 Refactoring with Strategy pattern
• 콜백 인터페이스가 적용된 공통 메소드
31. 한국 스프링 사용자 모임 (http://ksug.org) 31
1.4 Summary
• 구현한 템플릿 클래스와 인터페이스
32. 한국 스프링 사용자 모임 (http://ksug.org) 32
1.4 Summary
• JdbcTemplate 도입된 이후의 효과
– JDBC workflow 의 흐름 진행 주체
• DAO JdbcTemplate
– DAO 의 역할 충실화
• SQL, 파라미터 제공 or 결과 매핑
• 이 외의 다른 역할은 JdbcTemplate 를 비롯한 각 담당자에게 위임
33. 한국 스프링 사용자 모임 (http://ksug.org) 33
2. SPRING JDBCTEMPLATE
34. 한국 스프링 사용자 모임 (http://ksug.org) 34
2.1 Best Practice of JDBC Strategy
• Spring JDBC core package’s Central class
• Jdbc UseCase Best Practice
• Collaborate with Various Callback Interface
Strategy pattern!
• Convenience DA operation
"This is a special case of the Strategy design pattern.
It appears different because the interface involved
are so simple"
35. 한국 스프링 사용자 모임 (http://ksug.org) 35
2.1 Best Practice of JDBC Strategy
• JdbcTemplate with Strategy pattern
DAO
Template
Callback
Interface
implementation
참조 : wiki[2]
36. 한국 스프링 사용자 모임 (http://ksug.org) 36
2.1 Best Practice of JDBC Strategy
Jdbc-based DAO Spring-based DAO
DriverManager /
DataSource
DataSource
Statement /
PreparedStatement /
CallableStatement
JdbcTemplate /
Callback interface
ResultSet POJO / POJO’s
collection
37. 한국 스프링 사용자 모임 (http://ksug.org) 37
2.1 Best Practice of JDBC Strategy
Task Spring You
Connection(DataSource) management
Provide SQL
Statement management
Parameter Declaration
Provide parameter value
ResultSet management
Row Data Retrieval
Transaction management
Exception handling
38. 한국 스프링 사용자 모임 (http://ksug.org) 38
2.1 Best Practice of JDBC Strategy
• Convenience, but powerful Jdbc Template
– Resource management
• DataSourceUtils
– Integrated with Transaction management
• Spring-tx (non-invasive)
39. 한국 스프링 사용자 모임 (http://ksug.org) 39
2.1 Best Practice of JDBC Strategy
• Convenience, but powerful JdbcTemplate
– Consistent exception management
• 예외 발생 시 처리 기준
– 에러 코드 (error code), 에러 상태 (error state)
예외 종류 (type of Exception)
• Check exception Unchecked exception
• SQLExceptionTranslator
40. 한국 스프링 사용자 모임 (http://ksug.org) 40
2.1 Best Practice of JDBC Strategy
• Convenience, but powerful JdbcTemplate
– Logging for SQL inform. (DEBUG level)
– Various Template
• JdbcTemplate
• NamedParameterJdbcTemplate
• SimpleJdbcTemplate
– Convenience DA operation
• named parameter
• Auto-detect column by Jdbc Driver
• Easily using Batch, LOB
41. 한국 스프링 사용자 모임 (http://ksug.org) 41
2.1 Best Practice of JDBC Strategy
• JdbcTemplate 구성 방법
– DataSource(or Connection Pool) 가 쓰레드 안전하다면 ,
JdbcTemplate 도 쓰레드 안전
private JdbcTemplate template;
public void setTemplate(DataSource dataSource) {
this.template = new JdbcTemplate(dataSource);
}
<bean id="lectureDao"
class="org.springframework.lecture.jdbc.dao.JdbcLectureDao">
<property name="template" ref="dataSource" />
</bean>
private JdbcTemplate template;
public void setTemplate(JdbcTemplate template) {
this.template = template;
}
<bean id="lectureDao"
class="org.springframework.lecture.jdbc.dao.JdbcLectureDao">
<property name="template" ref="jdbcTemplate" />
</bean>
42. 한국 스프링 사용자 모임 (http://ksug.org) 42
2.2 SIMPLIFY JDBC OPERATION
43. 한국 스프링 사용자 모임 (http://ksug.org) 43
2.2 Simplify JDBC operation
• SimpleJdbc* 활용하기
– SimpleJdbcTemplate
• Wrapper around classic JdbcTemplate
class(getJdbcOperations())
• Java-5-based convenience wrapper for the classic Spring
JdbcTemplate
• Varargs, Generic, Autoboxing, Unboxing...
45. 한국 스프링 사용자 모임 (http://ksug.org) 45
2.2 Simplify JDBC operation
• SimpleJdbc* 활용하기
– SimpleJdbcCall
• multi-threaded, reusable object representing a call to
stored procedure or a stored function
– SimpleJdbcTestUtils
46. 한국 스프링 사용자 모임 (http://ksug.org) 46
2.2 Simplify JDBC operation
• The Pareto Principle in action
– JdbcTemplate+callback interface by Reflection = 80
– SqlQuery + inheritance by explicit parameter mapping
=20
47. 한국 스프링 사용자 모임 (http://ksug.org) 47
2.2 Simplify JDBC operation
• RowMapper(with ResultSetExtractor)
– per-row basis
– Stateless & reusable
– Ideal choice of row-mapping logic
• ResultSetExtractor
– per-resultSet basis
– Stateless & reusable, if not access stateful
resource
48. 한국 스프링 사용자 모임 (http://ksug.org) 48
2.2 Simplify JDBC operation
• SqlQuery
– by Inheritance
– Reusable, threadsafe class
– Encapsulate SQL
– MappingSqlQuery & UpdatableSqlQuery
– Using meaningful method name
49. 한국 스프링 사용자 모임 (http://ksug.org) 49
2.2 Simplify JDBC operation
• RowCallbackHandler
– Stateful
– public void processRow(ResultSet rs) throws
SQLException
51. 한국 스프링 사용자 모임 (http://ksug.org) 51
Reference
• wiki[1]:
http://en.wikipedia.org/wiki/Image:Strategy_Pattern_Diagram_ZP
• wiki[2]:
http://en.wikipedia.org/wiki/Image:Strategy_pattern_in_LePUS3.g
• Tomas[1]: JDBC Development with the Spring Framework
• Spring reference
• Spring API
• J2EE Design and Development
• J2EE without EJB