SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Midao
DATA ORIENTED UMBRELLA PROJECT
Midao Project
◦ What is it ?
◦ Midao is a Project which unites few data oriented projects under it's umbrella.
◦ Write once – execute everywhere ?
◦ Not really. Current world is all about information. Amount of tools to work with it grows very quickly, as infrastructure and complexity along
with it. Amount of development and support for such systems increases because of it's diversity and complexity. Midao was created to
simplify all that.
◦ When it would be released ?
◦ Midao JDBC was already released. Next libraries will be released as soon as they are ready (current deadline is end of 2014 – 2015)
◦ Why it takes so long ?
◦ Midao suppose to be next generation libraries which simplify development for different storage applications, improve portability, provide
single API for different databases, offer additional features (not provided by drivers) and, most importantly, is event based and simple to use.
It is a lot of work (due to lack of standards and different feature sets) and I am planning to invest as much time as needed in order to create
quality libraries worth using.
◦ What would be supported ?
◦ Goal is to provide support for as much data sources as possible.
◦ Which languages are supported ?
◦ Midao is developed using Java. In future, native support of other languages is possible.
◦ Which license is used ?
◦ Apache License Version 2.0.
ETA 2015
End of 2014
ETA 2015
Released
Midao components
Simplifies work with local/remote
data/file storage systems.
Simplifies work with distributed
cache/data grid systems.
Simplifies work with document
oriented databases (including but not
limited to NoSQL databases).
Simplifies work with relational databases
using Java JDBC.
Midao
JDBC
Midao
DOD*
Midao
File*
Midao
VOS*
Midao
Integration
* - those are code names and are subject to change
Midao JDBC
◦ What is it ?
◦ Midao JDBC is part of Midao Project. It is created to provide support for RDBMS Databases using JDBC driver.
◦ Write once – execute everywhere ?
◦ Not completely. Goal is to simplify: it hides complexity/nuances of vendor JDBC drivers, makes work with JDBC more comfortable
and ensures good performance by utilizing best practices.
◦ When can I use it ?
◦ You can start playing with it right now, but it is not ready for use in Production yet. Final release is planned in Autumn.
◦ What future holds ?
◦ List of features to be implemented is not small. Please visit http://midao.org/status.html details.
Why Midao JDBC ?
◦ It simplifies work with JDBC.
◦ Transactions, metadata, type handling, input/output processing, cached/lazy queries, named parameters etc.
◦ It simplifies work with vendor JDBC driver implementation.
◦ Supports Oracle Database, Microsoft SQL, Oracle MySQL, MariaDB, PostgreSQL etc.
◦ Vendor specific type handling/metadata/exception handling.
◦ It handles resources and provides best practices for you.
◦ Library ensures that all resources are used no longer than needed and are closed properly. Also it utilizes best practices while
working with JDBC Drivers.
◦ It provides additional functions for you.
◦ Profiling, Pooled Data Sources, Lazy query execution support.
◦ And with all of the above - it is still small and simple to use library.
What about others
◦ Midao JDBC vs Spring JDBC*.
◦ Smaller, simpler and little more customizable/extensible.
◦ Provides additional functionality not present in Spring JDBC.
◦ Doesn't require Spring container to work.
◦ Provides some support for Spring JDBC (templates, exception handlers, metadata).
◦ Apache DbUtils*.
◦ Handles much more JDBC boilerplate code.
◦ Provides much more functionality.
◦ Configurable/extensible.
◦ Midao JDBC follows principles set by DbUtils. Which results in easier migration and short learning curve for Apache DbUtils
projects.
◦ Midao JDBC vs Hibernate(and other ORM Libraries/Frameworks).
◦ Smaller and have better performance(because of direct JDBC usage).
◦ Midao JDBC is not an ORM Library/Framework nor tries to be one. It's main goal to work with SQL directly while providing
functionality to make it more comfortable to use object relational mapping when needed.
* - Migration Guide, with those points explained, due to lack of time - is currently on hold. If you have time to write one – please contact me (look feedback slide)
Start using
How to start ?
DownloadGrab midao-core-jdbc.jar at midao.org
Maven
Add Maven dependency:
• Dependencies:
• No mandatory dependencies.
• SLF4j is optional dependency and can be used if present.
• Support:
• Java 5&6.
• JDBC3&JDBC4.
<dependency>
<groupId>org.midao</groupId>
<artifactId>midao-jdbc-core</artifactId>
<version>0.9.4</version>
</dependency>
Often less is better
• At beginning focus on Query runner and Input/Output handlers.
• As you progress you might be interested in Type handlers, Pooled data sources, Transactions, Lazy
output handlers, Profiling and configuration of library.
• When you will arrive to the point when you think you want to improve it – it is worth looking at
Metadata handlers, Statement handlers and Exception handlers.
Assumptions
Before we start you need to set up your environment.
In below examples we assume that:
1. JDBC drivers were added to project Classpath via Eclipse or Maven/Ant.
2. You have SQL Connection received from DataSource or DriverManager.
3. Midao JDBC Core was added to project Classpath via Eclipse or Maven/Ant.
For full examples please consider viewing:
1. http://midao.org/home.html#examples
2. https://github.com/pryzach/midao/tree/master/midao-jdbc-examples/src/main/java/org/midao/jdbc/examples
Query runner, transactions and profiling
All queries are executed via Query Runner. In order to receive Query Runner instance Factory
can be used:
After runner instance is received – queries can be executed via:
Transactions are handled automatically by library (using auto-commit mode), but if you are
interested in manual handling you can do:
Profiling is switched off by default. In order to switch it on:
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn);
runner.batch()/runner.query()/runner.update()/runner.call();
runner.setTransactionManualMode(true);
...
runner.commit()/runner.rollback();
MjdbcConfig.setProfilerEnabled(true);
Input and Output handlers
Input handlers are responsible for handling query input: (named) SQL string and input
parameters:
Output handlers are responsible for handling query output (ResultSets):
Map<String, Object> queryParameters = new HashMap<String, Object>();
queryParameters.put("id", 1);
MapInputHandler input = new MapInputHandler(
"SELECT name FROM students WHERE id = :id", queryParameters);
Map<String, Object> result = runner.query(input, new MapOutputHandler());
System.out.println("Query output: " + result.get(“name”));
Hello World JDBC style
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn);
Map<String, Object> queryParameters = new HashMap<String, Object>();
queryParameters.put("id", 1);
MapInputHandler input = new MapInputHandler(
"SELECT name FROM students WHERE id = :id", queryParameters);
Map<String, Object> result = runner.query(input, new MapOutputHandler());
QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn);
BeanInputHandler<Student> input = null;
Student student = new Student();
student.setId(2);
// :id is IN parameter and :name and :address are OUT parameters
input = new BeanInputHandler<Student>("{call TEST_NAMED(:id, :name, :address)}", student);
// result would be filled student object searched by ID = 2. All values would come from OUT param.
Student result = runner.call(input);
Mapinput
example
Beaninput
example
What’s next ?
◦ Visit http://www.midao.org/
◦ Browse Midao JDBC code on GitHub.
◦ Browse Midao JDBC JavaDoc.
◦ Read getting started guide www.midao.org/mjdbc-getting-started.html
◦ Follow us on Freecode midao.
Feedback, suggestions and questions
◦ stackoverflow.com still is the best place to start asking questions.
◦ Java Ranch (JDBC forum) is monitored for questions related to Midao JDBC.
◦ Mailing lists can be used: questions@midao.org
◦ midao.org have feedback section(below) where you can provide one.
◦ And if everything else fails - you can always contact me directly:
pryzach@gmail.com.
Wow, you are still reading ?
Hope this library would be useful for you.
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...Ram Murat Sharma
 
Odi best-practice-data-warehouse-168255
Odi best-practice-data-warehouse-168255Odi best-practice-data-warehouse-168255
Odi best-practice-data-warehouse-168255nm2013
 
DotNetToscana: NoSQL Revolution - RavenDB
DotNetToscana: NoSQL Revolution - RavenDBDotNetToscana: NoSQL Revolution - RavenDB
DotNetToscana: NoSQL Revolution - RavenDBNicola Baldi
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseAnita Luthra
 
Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Ashnikbiz
 
Tips and Tricks of Toad for Oracle 10.6
Tips and Tricks of Toad for Oracle 10.6Tips and Tricks of Toad for Oracle 10.6
Tips and Tricks of Toad for Oracle 10.6Dsunte Wilson
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaEdureka!
 
Hibernate Interview Questions
Hibernate Interview QuestionsHibernate Interview Questions
Hibernate Interview QuestionsMayank Kumar
 
Oracle Exadata Interview Questions and Answers
Oracle Exadata Interview Questions and AnswersOracle Exadata Interview Questions and Answers
Oracle Exadata Interview Questions and AnswersExadatadba
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVABALUJAINSTITUTE
 
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise DirectoryCause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise Directoryrwgorrel
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVABALUJAINSTITUTE
 
Java Lesson English
Java Lesson EnglishJava Lesson English
Java Lesson Englisherdensaihana
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosqlbharati k
 
Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250Udaykumar Sarana
 
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...Edureka!
 

Was ist angesagt? (20)

Java script framework
Java script frameworkJava script framework
Java script framework
 
MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...MongoDB - A next-generation database that lets you create applications never ...
MongoDB - A next-generation database that lets you create applications never ...
 
Odi best-practice-data-warehouse-168255
Odi best-practice-data-warehouse-168255Odi best-practice-data-warehouse-168255
Odi best-practice-data-warehouse-168255
 
Odi interview questions
Odi interview questionsOdi interview questions
Odi interview questions
 
DotNetToscana: NoSQL Revolution - RavenDB
DotNetToscana: NoSQL Revolution - RavenDBDotNetToscana: NoSQL Revolution - RavenDB
DotNetToscana: NoSQL Revolution - RavenDB
 
Polyglot Persistence
Polyglot Persistence Polyglot Persistence
Polyglot Persistence
 
3 jdbc
3 jdbc3 jdbc
3 jdbc
 
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the EnterpriseSQL vs NoSQL: Big Data Adoption & Success in the Enterprise
SQL vs NoSQL: Big Data Adoption & Success in the Enterprise
 
Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1Enterprise-class security with PostgreSQL - 1
Enterprise-class security with PostgreSQL - 1
 
Tips and Tricks of Toad for Oracle 10.6
Tips and Tricks of Toad for Oracle 10.6Tips and Tricks of Toad for Oracle 10.6
Tips and Tricks of Toad for Oracle 10.6
 
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | EdurekaSQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
SQL vs NoSQL | MySQL vs MongoDB Tutorial | Edureka
 
Hibernate Interview Questions
Hibernate Interview QuestionsHibernate Interview Questions
Hibernate Interview Questions
 
Oracle Exadata Interview Questions and Answers
Oracle Exadata Interview Questions and AnswersOracle Exadata Interview Questions and Answers
Oracle Exadata Interview Questions and Answers
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise DirectoryCause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
Java Lesson English
Java Lesson EnglishJava Lesson English
Java Lesson English
 
Comparison between rdbms and nosql
Comparison between rdbms and nosqlComparison between rdbms and nosql
Comparison between rdbms and nosql
 
Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250Odi 12c-getting-started-guide-2032250
Odi 12c-getting-started-guide-2032250
 
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...
What is MySQL? | MySQL Tutorial For Beginners | Creating Databases & Tables |...
 

Andere mochten auch

Aircraftpartsaopa 120913203925-phpapp01
Aircraftpartsaopa 120913203925-phpapp01Aircraftpartsaopa 120913203925-phpapp01
Aircraftpartsaopa 120913203925-phpapp011tucker1
 
2013 workforce conference powerpoint data update
2013 workforce conference powerpoint data update2013 workforce conference powerpoint data update
2013 workforce conference powerpoint data updatepjonesocbc
 
chocoYum: Taste-Testing the Mobile Landscape
chocoYum: Taste-Testing the Mobile LandscapechocoYum: Taste-Testing the Mobile Landscape
chocoYum: Taste-Testing the Mobile LandscapePocket Change
 
ChocoYum: Taste-Testing The Mobile Advertising Landscape
ChocoYum: Taste-Testing The Mobile Advertising LandscapeChocoYum: Taste-Testing The Mobile Advertising Landscape
ChocoYum: Taste-Testing The Mobile Advertising LandscapePocket Change
 
Renewable and non renewable
Renewable and non renewableRenewable and non renewable
Renewable and non renewableLindylove
 
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property Tips
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property TipsNoon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property Tips
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property TipsNoonTurfCareMA
 

Andere mochten auch (8)

Kaizen lite
Kaizen liteKaizen lite
Kaizen lite
 
Aircraftpartsaopa 120913203925-phpapp01
Aircraftpartsaopa 120913203925-phpapp01Aircraftpartsaopa 120913203925-phpapp01
Aircraftpartsaopa 120913203925-phpapp01
 
2013 workforce conference powerpoint data update
2013 workforce conference powerpoint data update2013 workforce conference powerpoint data update
2013 workforce conference powerpoint data update
 
chocoYum: Taste-Testing the Mobile Landscape
chocoYum: Taste-Testing the Mobile LandscapechocoYum: Taste-Testing the Mobile Landscape
chocoYum: Taste-Testing the Mobile Landscape
 
ChocoYum: Taste-Testing The Mobile Advertising Landscape
ChocoYum: Taste-Testing The Mobile Advertising LandscapeChocoYum: Taste-Testing The Mobile Advertising Landscape
ChocoYum: Taste-Testing The Mobile Advertising Landscape
 
Spongebob
SpongebobSpongebob
Spongebob
 
Renewable and non renewable
Renewable and non renewableRenewable and non renewable
Renewable and non renewable
 
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property Tips
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property TipsNoon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property Tips
Noon Turf Care - Fall to Winter Lawn, Tree, Shrub, and Property Tips
 

Ähnlich wie Midao JDBC presentation

Java database programming with jdbc
Java database programming with jdbcJava database programming with jdbc
Java database programming with jdbcsriram raj
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsmichaelaaron25322
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptxYastee Shah
 
Connect2014 Show104: Practical Java
Connect2014 Show104: Practical JavaConnect2014 Show104: Practical Java
Connect2014 Show104: Practical Javapanagenda
 
Choosing an IdM User Store technology
Choosing an IdM User Store technologyChoosing an IdM User Store technology
Choosing an IdM User Store technologyMichael J Geiser
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsBuhake Sindi
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Oracle Developers
 
java.pptx
java.pptxjava.pptx
java.pptxbfgd1
 
SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical JavaMark Myers
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBMarco Segato
 
web development 7.pptx
web development 7.pptxweb development 7.pptx
web development 7.pptxharshit762481
 

Ähnlich wie Midao JDBC presentation (20)

Java database programming with jdbc
Java database programming with jdbcJava database programming with jdbc
Java database programming with jdbc
 
JDBC
JDBCJDBC
JDBC
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptx
 
Connect2014 Show104: Practical Java
Connect2014 Show104: Practical JavaConnect2014 Show104: Practical Java
Connect2014 Show104: Practical Java
 
Spring Data JPA
Spring Data JPASpring Data JPA
Spring Data JPA
 
Core jdbc basics
Core jdbc basicsCore jdbc basics
Core jdbc basics
 
Choosing an IdM User Store technology
Choosing an IdM User Store technologyChoosing an IdM User Store technology
Choosing an IdM User Store technology
 
Dao example
Dao exampleDao example
Dao example
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Managing Data in Jakarta EE Applications
Managing Data in Jakarta EE ApplicationsManaging Data in Jakarta EE Applications
Managing Data in Jakarta EE Applications
 
Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018Silicon Valley JUG meetup July 18, 2018
Silicon Valley JUG meetup July 18, 2018
 
Jdbc
JdbcJdbc
Jdbc
 
java.pptx
java.pptxjava.pptx
java.pptx
 
SHOW104: Practical Java
SHOW104: Practical JavaSHOW104: Practical Java
SHOW104: Practical Java
 
SQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDBSQL vs NoSQL, an experiment with MongoDB
SQL vs NoSQL, an experiment with MongoDB
 
web development 7.pptx
web development 7.pptxweb development 7.pptx
web development 7.pptx
 
Advanced JAVA
Advanced JAVAAdvanced JAVA
Advanced JAVA
 
Chap3 3 12
Chap3 3 12Chap3 3 12
Chap3 3 12
 
java 4 Part 1 computer science.pptx
java 4 Part 1 computer science.pptxjava 4 Part 1 computer science.pptx
java 4 Part 1 computer science.pptx
 

Kürzlich hochgeladen

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Kürzlich hochgeladen (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Midao JDBC presentation

  • 2. Midao Project ◦ What is it ? ◦ Midao is a Project which unites few data oriented projects under it's umbrella. ◦ Write once – execute everywhere ? ◦ Not really. Current world is all about information. Amount of tools to work with it grows very quickly, as infrastructure and complexity along with it. Amount of development and support for such systems increases because of it's diversity and complexity. Midao was created to simplify all that. ◦ When it would be released ? ◦ Midao JDBC was already released. Next libraries will be released as soon as they are ready (current deadline is end of 2014 – 2015) ◦ Why it takes so long ? ◦ Midao suppose to be next generation libraries which simplify development for different storage applications, improve portability, provide single API for different databases, offer additional features (not provided by drivers) and, most importantly, is event based and simple to use. It is a lot of work (due to lack of standards and different feature sets) and I am planning to invest as much time as needed in order to create quality libraries worth using. ◦ What would be supported ? ◦ Goal is to provide support for as much data sources as possible. ◦ Which languages are supported ? ◦ Midao is developed using Java. In future, native support of other languages is possible. ◦ Which license is used ? ◦ Apache License Version 2.0.
  • 3. ETA 2015 End of 2014 ETA 2015 Released Midao components Simplifies work with local/remote data/file storage systems. Simplifies work with distributed cache/data grid systems. Simplifies work with document oriented databases (including but not limited to NoSQL databases). Simplifies work with relational databases using Java JDBC. Midao JDBC Midao DOD* Midao File* Midao VOS* Midao Integration * - those are code names and are subject to change
  • 4. Midao JDBC ◦ What is it ? ◦ Midao JDBC is part of Midao Project. It is created to provide support for RDBMS Databases using JDBC driver. ◦ Write once – execute everywhere ? ◦ Not completely. Goal is to simplify: it hides complexity/nuances of vendor JDBC drivers, makes work with JDBC more comfortable and ensures good performance by utilizing best practices. ◦ When can I use it ? ◦ You can start playing with it right now, but it is not ready for use in Production yet. Final release is planned in Autumn. ◦ What future holds ? ◦ List of features to be implemented is not small. Please visit http://midao.org/status.html details.
  • 5. Why Midao JDBC ? ◦ It simplifies work with JDBC. ◦ Transactions, metadata, type handling, input/output processing, cached/lazy queries, named parameters etc. ◦ It simplifies work with vendor JDBC driver implementation. ◦ Supports Oracle Database, Microsoft SQL, Oracle MySQL, MariaDB, PostgreSQL etc. ◦ Vendor specific type handling/metadata/exception handling. ◦ It handles resources and provides best practices for you. ◦ Library ensures that all resources are used no longer than needed and are closed properly. Also it utilizes best practices while working with JDBC Drivers. ◦ It provides additional functions for you. ◦ Profiling, Pooled Data Sources, Lazy query execution support. ◦ And with all of the above - it is still small and simple to use library.
  • 6. What about others ◦ Midao JDBC vs Spring JDBC*. ◦ Smaller, simpler and little more customizable/extensible. ◦ Provides additional functionality not present in Spring JDBC. ◦ Doesn't require Spring container to work. ◦ Provides some support for Spring JDBC (templates, exception handlers, metadata). ◦ Apache DbUtils*. ◦ Handles much more JDBC boilerplate code. ◦ Provides much more functionality. ◦ Configurable/extensible. ◦ Midao JDBC follows principles set by DbUtils. Which results in easier migration and short learning curve for Apache DbUtils projects. ◦ Midao JDBC vs Hibernate(and other ORM Libraries/Frameworks). ◦ Smaller and have better performance(because of direct JDBC usage). ◦ Midao JDBC is not an ORM Library/Framework nor tries to be one. It's main goal to work with SQL directly while providing functionality to make it more comfortable to use object relational mapping when needed. * - Migration Guide, with those points explained, due to lack of time - is currently on hold. If you have time to write one – please contact me (look feedback slide)
  • 8. How to start ? DownloadGrab midao-core-jdbc.jar at midao.org Maven Add Maven dependency: • Dependencies: • No mandatory dependencies. • SLF4j is optional dependency and can be used if present. • Support: • Java 5&6. • JDBC3&JDBC4. <dependency> <groupId>org.midao</groupId> <artifactId>midao-jdbc-core</artifactId> <version>0.9.4</version> </dependency>
  • 9. Often less is better • At beginning focus on Query runner and Input/Output handlers. • As you progress you might be interested in Type handlers, Pooled data sources, Transactions, Lazy output handlers, Profiling and configuration of library. • When you will arrive to the point when you think you want to improve it – it is worth looking at Metadata handlers, Statement handlers and Exception handlers.
  • 10. Assumptions Before we start you need to set up your environment. In below examples we assume that: 1. JDBC drivers were added to project Classpath via Eclipse or Maven/Ant. 2. You have SQL Connection received from DataSource or DriverManager. 3. Midao JDBC Core was added to project Classpath via Eclipse or Maven/Ant. For full examples please consider viewing: 1. http://midao.org/home.html#examples 2. https://github.com/pryzach/midao/tree/master/midao-jdbc-examples/src/main/java/org/midao/jdbc/examples
  • 11. Query runner, transactions and profiling All queries are executed via Query Runner. In order to receive Query Runner instance Factory can be used: After runner instance is received – queries can be executed via: Transactions are handled automatically by library (using auto-commit mode), but if you are interested in manual handling you can do: Profiling is switched off by default. In order to switch it on: QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn); runner.batch()/runner.query()/runner.update()/runner.call(); runner.setTransactionManualMode(true); ... runner.commit()/runner.rollback(); MjdbcConfig.setProfilerEnabled(true);
  • 12. Input and Output handlers Input handlers are responsible for handling query input: (named) SQL string and input parameters: Output handlers are responsible for handling query output (ResultSets): Map<String, Object> queryParameters = new HashMap<String, Object>(); queryParameters.put("id", 1); MapInputHandler input = new MapInputHandler( "SELECT name FROM students WHERE id = :id", queryParameters); Map<String, Object> result = runner.query(input, new MapOutputHandler()); System.out.println("Query output: " + result.get(“name”));
  • 13. Hello World JDBC style QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn); Map<String, Object> queryParameters = new HashMap<String, Object>(); queryParameters.put("id", 1); MapInputHandler input = new MapInputHandler( "SELECT name FROM students WHERE id = :id", queryParameters); Map<String, Object> result = runner.query(input, new MapOutputHandler()); QueryRunnerService runner = MjdbcFactory.getQueryRunner(conn); BeanInputHandler<Student> input = null; Student student = new Student(); student.setId(2); // :id is IN parameter and :name and :address are OUT parameters input = new BeanInputHandler<Student>("{call TEST_NAMED(:id, :name, :address)}", student); // result would be filled student object searched by ID = 2. All values would come from OUT param. Student result = runner.call(input); Mapinput example Beaninput example
  • 14. What’s next ? ◦ Visit http://www.midao.org/ ◦ Browse Midao JDBC code on GitHub. ◦ Browse Midao JDBC JavaDoc. ◦ Read getting started guide www.midao.org/mjdbc-getting-started.html ◦ Follow us on Freecode midao.
  • 15. Feedback, suggestions and questions ◦ stackoverflow.com still is the best place to start asking questions. ◦ Java Ranch (JDBC forum) is monitored for questions related to Midao JDBC. ◦ Mailing lists can be used: questions@midao.org ◦ midao.org have feedback section(below) where you can provide one. ◦ And if everything else fails - you can always contact me directly: pryzach@gmail.com.
  • 16. Wow, you are still reading ? Hope this library would be useful for you. THANK YOU