SlideShare une entreprise Scribd logo
1  sur  25
Informix Java Driver
JDBC Features
(4.10.JC8)
Brian Hughes
Agenda
• Internal Improvements
• 4.10.JC8
– JDBC 4.0 Spec compliance
– Jar file repackaging
2
Internal Improvements
• Re-investing in the driver
– Modernizing how we build and test the JDBC
driver essential for adding more value
• Prior model was “isn’t broken, don’t fix it”
– Though it wasn’t broken it was slow process to
build and test new versions of the driver
• Few metrics
– Pass rates and build time was all that was
available
3
Internal Improvements
• Focus areas
– Faster turnaround time (fail fast)
– More information (metrics)
– Better testing (coverage, ease of use)
– Portability (build on any machine with little setup)
4
Failing Fast
• Build + test for the JDBC driver took almost 2
hours before
– Ran on a cron job that ran once a day
• Could do some testing locally before checkin,
but most validation came with the overnight
testing
• Build and test needed an overhaul
5
Failing Fast
• Ported all tests into TestNG (Java unit test
framework)
• Setup so we can run tests locally or on a ‘build’
machine
• Switched from perl scripts (yes we used perl) to
Gradle for building the driver
• Build time
– 4.10.JC7 - 40 minutes
– 4.10.JC8 - 3 minutes
• Test time
– 4.10.JC7 – 45 minutes
– 4.10.JC8 – 10 minutes
6
More Information (Metrics)
• Metrics are useful guides to indicate problem
areas or trends in code quality
• Coupled with testing and user feedback
metrics can alert us to potentially dangerous
or high risk additions to the product early on.
7
Metics
• Warnings
– over the years Java and code practices introduced
a number of warnings into the code
– even benign ones clutter and obscure potentially
dangerous warnings
• Code coverage
– How well does our testing cover the product, is
the coverage in the right areas?
– Very important for refactoring code, adds
confidence we didn’t break anything
8
Metics
• Static code analysis
– Augments testing with scans of the source code
for patterns that indicate potential problems
– Can be a little noisy with false positives
• Code complexity
– Identifies complex code blocks (nested
if/while/switch blocks)
– Points out interdependencies between
components
– Complex code === buggy code
• Also good points for refactoring the code
9
The Value
• All these pieces come together to allow faster
product development
• Case study 4.10.JC8
– Added ~100 tests
– Added ~100 new API’s
– Reduced compilation warnings by 1200
– Increased test coverage
10
4.10.JC8 Features
• JDBC 4.0 Compliance
– Almost a hundred new API’s implemented or
enhanced to provide 4.0 compliance
– Compliance doesn’t mean all JDBC methods
supported
• We will go through the some of the more
interesting/useful
11
4.10.JC8 Features
• ResultSet
– isClosed() and getHoldability()
– update* methods now work with long values
– Before this was what you had
• resultSet.updateBlob(“blobcolumn”, inputStream, int length);
– Now you can also use
• resultSet.updateBlob(“blobcolumn”, inputStream, long length);
– Before 4.10.JC8 you couldn’t always send an input stream
that didn’t have a length specified, now you can
• resultSet.updateAsciiStream(“charcolumn”, new
FileInputStream(“/myfile.txt”));
– This was done for all resultset update API’s
12
ResultSet API additions
13
boolean isClosed() throws SQLException;
int getHoldability() throws SQLException;
void updateAsciiStream(int columnIndex,java.io.InputStream x,long length) throws SQLException;
void updateAsciiStream(String columnLabel,java.io.InputStream x,long length) throws SQLException;
void updateAsciiStream(int columnIndex, java.io.InputStream x) throws SQLException;
void updateAsciiStream(String columnLabel, java.io.InputStream x) throws SQLException;
void updateBinaryStream(int columnIndex, java.io.InputStream x) throws SQLException;
void updateBinaryStream(String columnLabel, java.io.InputStream x) throws SQLException;
void updateBinaryStream(String columnLabel,java.io.InputStream x,long length) throws SQLException;
void updateBinaryStream(int columnIndex,java.io.InputStream x,long length) throws SQLException;
void updateCharacterStream(int columnIndex, java.io.Reader x) throws SQLException;
void updateCharacterStream(String columnLabel, java.io.Reader reader) throws SQLException;
void updateCharacterStream(String columnLabel,java.io.Reader reader,long length) throws SQLException;
void updateCharacterStream(int columnIndex,java.io.Reader x,long length) throws SQLException;
void updateBlob(int columnIndex, InputStream inputStream) throws SQLException;
void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException;
void updateBlob(String columnLabel, InputStream inputStream) throws SQLException;
void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException;
void updateClob(int columnIndex, Reader reader, long length) throws SQLException;
void updateClob(int columnIndex, Reader reader) throws SQLException;
void updateClob(String columnLabel, Reader reader) throws SQLException;
void updateNString(int columnIndex, String nString) throws SQLException;
void updateNString(String columnLabel, String nString) throws SQLException;
void updateNClob(int columnIndex, NClob nClob) throws SQLException;
void updateNClob(String columnLabel, NClob nClob) throws SQLException;
void updateNCharacterStream(int columnIndex,java.io.Reader x,long length) throws SQLException;
void updateNCharacterStream(String columnLabel,java.io.Reader reader,long length) throws SQLException
void updateNClob(int columnIndex, Reader reader, long length) throws SQLException;
void updateNClob(String columnLabel, Reader reader, long length) throws SQLException;
void updateNCharacterStream(int columnIndex, java.io.Reader x) throws SQLException;
void updateNCharacterStream(String columnLabel, java.io.Reader reader) throws SQLException;
void updateNClob(int columnIndex, Reader reader) throws SQLException;
void updateNClob(String columnLabel, Reader reader) throws SQLException;
JDBC 4.0 Compliance
• Connection.java
– Gets proper createBlob() createClob() API’s
• Statement objects get a minor update
boolean isClosed() throws SQLException;
void setPoolable(boolean poolable) throws SQLException;
boolean isPoolable() throws SQLException;
• Blob API gets filled out a bit
free();
getBinaryStream(long pos, long length);
• Clob API gets filled out a bit
free();
getCharacterStream(long pos, long length);
14
PreparedStatement
• Added ability to use long data type in set* API’s
– Before you could only set up to a 2gb object due to
the use of int, now you can try to shove up to
Informix’s max limit blob/clob data
• Fixed a few areas around if you pass us a Reader
or InputStream as we could incorrectly try to
figure out how long it was. We should correctly
pull in data from the stream now
• Implemented more set* API’s around clobs,
character streams
• CallableStatment gets the same treatment
15
PreparedStatement
16
void setClob(int parameterIndex, Reader reader, long length) throws SQLException;
void setClob(int parameterIndex, Reader reader)throws SQLException;
void setBlob(int parameterIndex, InputStream inputStream, long length)throws SQLException;
void setBlob(int parameterIndex, InputStream inputStream) throws SQLException;
void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException;
void setAsciiStream(int parameterIndex, java.io.InputStream x, long length) throws SQLException;
void setAsciiStream(int parameterIndex, java.io.InputStream x)throws SQLException;
void setBinaryStream(int parameterIndex, java.io.InputStream x, long length) throws SQLException;
void setBinaryStream(int parameterIndex, java.io.InputStream x)throws SQLException;
void setCharacterStream(int parameterIndex, java.io.Reader reader, long length) throws SQLException;
void setCharacterStream(int parameterIndex,java.io.Reader reader) throws SQLException;
IfxSmartBlob
• A prerequisite for a number of JDBC 4.0
compliance implementations, we needed to be
able to write streamed data to a smart large
object.
• Added 6 new method calls to IfxSmartBlob.java
– These are helper methods for your existing Blob/Clob
API’s
– They allow streaming of any length of data from a
stream object in Java into a blob/clob (up to what
Informix supports or the size of a long which is huge)
public long write(int lofd, InputStream is) throws SQLException
public long write(int lofd, InputStream is, long length) throws SQLException
public long writeWithConversion(int lofd, InputStream is) throws SQLException
public long writeWithConversion(int lofd, InputStream is, long length) throws SQLException
public long writeWithConversion(int lofd, Reader r) throws SQLException
public long writeWithConversion(int lofd, Reader, long length) throws SQLException
17
IfxSmartBlob
• Created a default 32k buffer (matching the
internal 32K buffer size we use for sending
chunks of data through the network
– Adjustable with setWriteStreamBufferSize(int)
• Any codeset conversion that used to be done
via a write to a temp file is not done purely in
memory
– Much faster and we avoid creating files on disk to
do this work
18
DatabaseMetaData
19
java.sql.DatabaseMetaData.sqlStateSQL = 2 New State for DatabaseMetaData.getSQLStateType()
RowIdLifetime getRowIdLifetime() throws SQLException;
ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException;
boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException;
boolean autoCommitFailureClosesAllResultSets() throws SQLException;
ResultSet getClientInfoProperties() throws SQLException;
ResultSet getFunctions(String catalog, String schemaPattern,String functionNamePattern) throws
SQLException;
ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String
columnNamePattern) throws SQLException;
• Useful for middleware applications that work
with many drivers
– Example: Cognos
4.10.JC8 Features
• JDBC Packaging
– Combined ifxjdbc.jar and ifxjdbcx.jar
– Removed the old ifxjdbcx.jar
• It was small, with extra overhead to build and test, and it’s features
complimented what was in ifxjdbc.jar already
– Removed SQLJ from the JDBC installer
• Not maintained, can still get it from older drivers or IBM JCC
• Simplifies and streamlines what we produce and what you see.
– Javadoc we produce no longer has the BSON API’s
• Javadocs and source for Bson available online already
• http://api.mongodb.com/java/2.2
• IfxDriver.connect() no longer requires a properties object
– Was annoying to have to code
Connection con = new IfxDriver(new Properties()).connect(….)
– Now can write
Connection con = new IfxDriver().connect(….)
20
JDBC and Maven
• Starting with 4.10.JC8W1
• JDBC drivers are published to maven central!!
• Prior work with Gradle builds makes this easier to
achieve.
• Most direct implementation of DevOps,
continuous delivery yet for Informix
• Versioning
– Maven artifacts prefer semantic versioning
– For JDBC we use 3 or 4 digits
• Latest JDBC driver 4.10.8.1
• Next JDBC driver likely is 4.10.9
21
JDBC and Maven
• Accessing the driver is easier than ever
• Bypasses hurdles with publishing through
prior mechanisms
http://mvnrepository.com/artifact/com.ibm.informi
x/jdbc/4.10.8.1
• Link takes you to Maven’s search page with
details about the driver and version
• You can directly download the jar from pages
like this
22
Informix JDBC on Maven
23
JDBC and Maven
• This allows you to easily and programmatically
grab the driver
• Using your own Gradle, Maven, SBT to pull in
latest versions of the driver
• Can even use ‘curl’ or wget to pull down the
file directly from the web
• Can stage drivers into your own internal
Maven repository
24
25
Thank
You

Contenu connexe

Tendances

Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akkanartamonov
 
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...Cisco DevNet
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cAjith Narayanan
 
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentFault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentOrkhan Gasimov
 
SQL in the Hybrid World
SQL in the Hybrid WorldSQL in the Hybrid World
SQL in the Hybrid WorldTanel Poder
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Vinaykumar Hebballi
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5aminmesbahi
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkVijay Nair
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSam Brannen
 
Java Enterprise Edition Concurrency Misconceptions
Java Enterprise Edition Concurrency Misconceptions Java Enterprise Edition Concurrency Misconceptions
Java Enterprise Edition Concurrency Misconceptions Haim Yadid
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...jeckels
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6aminmesbahi
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser ComparisonAllan Huang
 
Lightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileLightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileJosh Juneau
 
Migration strategies 4
Migration strategies 4Migration strategies 4
Migration strategies 4Wenhua Wang
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductorvedu12
 

Tendances (20)

Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Above the clouds: introducing Akka
Above the clouds: introducing AkkaAbove the clouds: introducing Akka
Above the clouds: introducing Akka
 
Java 11 OMG
Java 11 OMGJava 11 OMG
Java 11 OMG
 
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...DEVNET-2002	Coding 201: Coding Skills 201: Going Further with REST and Python...
DEVNET-2002 Coding 201: Coding Skills 201: Going Further with REST and Python...
 
Performance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12cPerformance Tuning Oracle Weblogic Server 12c
Performance Tuning Oracle Weblogic Server 12c
 
Fault Tolerance in Distributed Environment
Fault Tolerance in Distributed EnvironmentFault Tolerance in Distributed Environment
Fault Tolerance in Distributed Environment
 
SQL in the Hybrid World
SQL in the Hybrid WorldSQL in the Hybrid World
SQL in the Hybrid World
 
Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2Open Ldap Integration and Configuration with Lifray 6.2
Open Ldap Integration and Configuration with Lifray 6.2
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5
 
JUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talkJUDCON India 2014 Java EE 7 talk
JUDCON India 2014 Java EE 7 talk
 
Spring Framework 3.2 - What's New
Spring Framework 3.2 - What's NewSpring Framework 3.2 - What's New
Spring Framework 3.2 - What's New
 
Java Enterprise Edition Concurrency Misconceptions
Java Enterprise Edition Concurrency Misconceptions Java Enterprise Edition Concurrency Misconceptions
Java Enterprise Edition Concurrency Misconceptions
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser Comparison
 
Connection Pooling
Connection PoolingConnection Pooling
Connection Pooling
 
Lightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfileLightweight Java EE with MicroProfile
Lightweight Java EE with MicroProfile
 
Migration strategies 4
Migration strategies 4Migration strategies 4
Migration strategies 4
 
Evolution of netflix conductor
Evolution of netflix conductorEvolution of netflix conductor
Evolution of netflix conductor
 

Similaire à Informix Java Driver JDBC Features

What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»DataArt
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Igalia
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkIonic Security
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopFastly
 
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)Kevin Sutter
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Ryan Cuprak
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsTeamstudio
 
Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsVMware Tanzu
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Sunghyouk Bae
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaMax Alexejev
 
Why so continuous
Why so continuousWhy so continuous
Why so continuousMax Lobur
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet backdoor
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock FrameworkEugene Dvorkin
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSPGary Yeh
 

Similaire à Informix Java Driver JDBC Features (20)

What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Advanced Java Testing
Advanced Java TestingAdvanced Java Testing
Advanced Java Testing
 
Best Of Jdk 7
Best Of Jdk 7Best Of Jdk 7
Best Of Jdk 7
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
 
Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)Streams API (Web Engines Hackfest 2015)
Streams API (Web Engines Hackfest 2015)
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on Spark
 
Altitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly WorkshopAltitude San Francisco 2018: Testing with Fastly Workshop
Altitude San Francisco 2018: Testing with Fastly Workshop
 
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)InterConnect 2016 Java EE 7 Overview (PEJ-5296)
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden Gems
 
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018Kotlin @ Coupang Backed - JetBrains Day seoul 2018
Kotlin @ Coupang Backed - JetBrains Day seoul 2018
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
Servlets
ServletsServlets
Servlets
 
Why so continuous
Why so continuousWhy so continuous
Why so continuous
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
Java 7 & 8
Java 7 & 8Java 7 & 8
Java 7 & 8
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock Framework
 
Servlet and JSP
Servlet and JSPServlet and JSP
Servlet and JSP
 

Dernier

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 

Dernier (20)

20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 

Informix Java Driver JDBC Features

  • 1. Informix Java Driver JDBC Features (4.10.JC8) Brian Hughes
  • 2. Agenda • Internal Improvements • 4.10.JC8 – JDBC 4.0 Spec compliance – Jar file repackaging 2
  • 3. Internal Improvements • Re-investing in the driver – Modernizing how we build and test the JDBC driver essential for adding more value • Prior model was “isn’t broken, don’t fix it” – Though it wasn’t broken it was slow process to build and test new versions of the driver • Few metrics – Pass rates and build time was all that was available 3
  • 4. Internal Improvements • Focus areas – Faster turnaround time (fail fast) – More information (metrics) – Better testing (coverage, ease of use) – Portability (build on any machine with little setup) 4
  • 5. Failing Fast • Build + test for the JDBC driver took almost 2 hours before – Ran on a cron job that ran once a day • Could do some testing locally before checkin, but most validation came with the overnight testing • Build and test needed an overhaul 5
  • 6. Failing Fast • Ported all tests into TestNG (Java unit test framework) • Setup so we can run tests locally or on a ‘build’ machine • Switched from perl scripts (yes we used perl) to Gradle for building the driver • Build time – 4.10.JC7 - 40 minutes – 4.10.JC8 - 3 minutes • Test time – 4.10.JC7 – 45 minutes – 4.10.JC8 – 10 minutes 6
  • 7. More Information (Metrics) • Metrics are useful guides to indicate problem areas or trends in code quality • Coupled with testing and user feedback metrics can alert us to potentially dangerous or high risk additions to the product early on. 7
  • 8. Metics • Warnings – over the years Java and code practices introduced a number of warnings into the code – even benign ones clutter and obscure potentially dangerous warnings • Code coverage – How well does our testing cover the product, is the coverage in the right areas? – Very important for refactoring code, adds confidence we didn’t break anything 8
  • 9. Metics • Static code analysis – Augments testing with scans of the source code for patterns that indicate potential problems – Can be a little noisy with false positives • Code complexity – Identifies complex code blocks (nested if/while/switch blocks) – Points out interdependencies between components – Complex code === buggy code • Also good points for refactoring the code 9
  • 10. The Value • All these pieces come together to allow faster product development • Case study 4.10.JC8 – Added ~100 tests – Added ~100 new API’s – Reduced compilation warnings by 1200 – Increased test coverage 10
  • 11. 4.10.JC8 Features • JDBC 4.0 Compliance – Almost a hundred new API’s implemented or enhanced to provide 4.0 compliance – Compliance doesn’t mean all JDBC methods supported • We will go through the some of the more interesting/useful 11
  • 12. 4.10.JC8 Features • ResultSet – isClosed() and getHoldability() – update* methods now work with long values – Before this was what you had • resultSet.updateBlob(“blobcolumn”, inputStream, int length); – Now you can also use • resultSet.updateBlob(“blobcolumn”, inputStream, long length); – Before 4.10.JC8 you couldn’t always send an input stream that didn’t have a length specified, now you can • resultSet.updateAsciiStream(“charcolumn”, new FileInputStream(“/myfile.txt”)); – This was done for all resultset update API’s 12
  • 13. ResultSet API additions 13 boolean isClosed() throws SQLException; int getHoldability() throws SQLException; void updateAsciiStream(int columnIndex,java.io.InputStream x,long length) throws SQLException; void updateAsciiStream(String columnLabel,java.io.InputStream x,long length) throws SQLException; void updateAsciiStream(int columnIndex, java.io.InputStream x) throws SQLException; void updateAsciiStream(String columnLabel, java.io.InputStream x) throws SQLException; void updateBinaryStream(int columnIndex, java.io.InputStream x) throws SQLException; void updateBinaryStream(String columnLabel, java.io.InputStream x) throws SQLException; void updateBinaryStream(String columnLabel,java.io.InputStream x,long length) throws SQLException; void updateBinaryStream(int columnIndex,java.io.InputStream x,long length) throws SQLException; void updateCharacterStream(int columnIndex, java.io.Reader x) throws SQLException; void updateCharacterStream(String columnLabel, java.io.Reader reader) throws SQLException; void updateCharacterStream(String columnLabel,java.io.Reader reader,long length) throws SQLException; void updateCharacterStream(int columnIndex,java.io.Reader x,long length) throws SQLException; void updateBlob(int columnIndex, InputStream inputStream) throws SQLException; void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException; void updateBlob(String columnLabel, InputStream inputStream) throws SQLException; void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException; void updateClob(int columnIndex, Reader reader, long length) throws SQLException; void updateClob(int columnIndex, Reader reader) throws SQLException; void updateClob(String columnLabel, Reader reader) throws SQLException; void updateNString(int columnIndex, String nString) throws SQLException; void updateNString(String columnLabel, String nString) throws SQLException; void updateNClob(int columnIndex, NClob nClob) throws SQLException; void updateNClob(String columnLabel, NClob nClob) throws SQLException; void updateNCharacterStream(int columnIndex,java.io.Reader x,long length) throws SQLException; void updateNCharacterStream(String columnLabel,java.io.Reader reader,long length) throws SQLException void updateNClob(int columnIndex, Reader reader, long length) throws SQLException; void updateNClob(String columnLabel, Reader reader, long length) throws SQLException; void updateNCharacterStream(int columnIndex, java.io.Reader x) throws SQLException; void updateNCharacterStream(String columnLabel, java.io.Reader reader) throws SQLException; void updateNClob(int columnIndex, Reader reader) throws SQLException; void updateNClob(String columnLabel, Reader reader) throws SQLException;
  • 14. JDBC 4.0 Compliance • Connection.java – Gets proper createBlob() createClob() API’s • Statement objects get a minor update boolean isClosed() throws SQLException; void setPoolable(boolean poolable) throws SQLException; boolean isPoolable() throws SQLException; • Blob API gets filled out a bit free(); getBinaryStream(long pos, long length); • Clob API gets filled out a bit free(); getCharacterStream(long pos, long length); 14
  • 15. PreparedStatement • Added ability to use long data type in set* API’s – Before you could only set up to a 2gb object due to the use of int, now you can try to shove up to Informix’s max limit blob/clob data • Fixed a few areas around if you pass us a Reader or InputStream as we could incorrectly try to figure out how long it was. We should correctly pull in data from the stream now • Implemented more set* API’s around clobs, character streams • CallableStatment gets the same treatment 15
  • 16. PreparedStatement 16 void setClob(int parameterIndex, Reader reader, long length) throws SQLException; void setClob(int parameterIndex, Reader reader)throws SQLException; void setBlob(int parameterIndex, InputStream inputStream, long length)throws SQLException; void setBlob(int parameterIndex, InputStream inputStream) throws SQLException; void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException; void setAsciiStream(int parameterIndex, java.io.InputStream x, long length) throws SQLException; void setAsciiStream(int parameterIndex, java.io.InputStream x)throws SQLException; void setBinaryStream(int parameterIndex, java.io.InputStream x, long length) throws SQLException; void setBinaryStream(int parameterIndex, java.io.InputStream x)throws SQLException; void setCharacterStream(int parameterIndex, java.io.Reader reader, long length) throws SQLException; void setCharacterStream(int parameterIndex,java.io.Reader reader) throws SQLException;
  • 17. IfxSmartBlob • A prerequisite for a number of JDBC 4.0 compliance implementations, we needed to be able to write streamed data to a smart large object. • Added 6 new method calls to IfxSmartBlob.java – These are helper methods for your existing Blob/Clob API’s – They allow streaming of any length of data from a stream object in Java into a blob/clob (up to what Informix supports or the size of a long which is huge) public long write(int lofd, InputStream is) throws SQLException public long write(int lofd, InputStream is, long length) throws SQLException public long writeWithConversion(int lofd, InputStream is) throws SQLException public long writeWithConversion(int lofd, InputStream is, long length) throws SQLException public long writeWithConversion(int lofd, Reader r) throws SQLException public long writeWithConversion(int lofd, Reader, long length) throws SQLException 17
  • 18. IfxSmartBlob • Created a default 32k buffer (matching the internal 32K buffer size we use for sending chunks of data through the network – Adjustable with setWriteStreamBufferSize(int) • Any codeset conversion that used to be done via a write to a temp file is not done purely in memory – Much faster and we avoid creating files on disk to do this work 18
  • 19. DatabaseMetaData 19 java.sql.DatabaseMetaData.sqlStateSQL = 2 New State for DatabaseMetaData.getSQLStateType() RowIdLifetime getRowIdLifetime() throws SQLException; ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException; boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException; boolean autoCommitFailureClosesAllResultSets() throws SQLException; ResultSet getClientInfoProperties() throws SQLException; ResultSet getFunctions(String catalog, String schemaPattern,String functionNamePattern) throws SQLException; ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException; • Useful for middleware applications that work with many drivers – Example: Cognos
  • 20. 4.10.JC8 Features • JDBC Packaging – Combined ifxjdbc.jar and ifxjdbcx.jar – Removed the old ifxjdbcx.jar • It was small, with extra overhead to build and test, and it’s features complimented what was in ifxjdbc.jar already – Removed SQLJ from the JDBC installer • Not maintained, can still get it from older drivers or IBM JCC • Simplifies and streamlines what we produce and what you see. – Javadoc we produce no longer has the BSON API’s • Javadocs and source for Bson available online already • http://api.mongodb.com/java/2.2 • IfxDriver.connect() no longer requires a properties object – Was annoying to have to code Connection con = new IfxDriver(new Properties()).connect(….) – Now can write Connection con = new IfxDriver().connect(….) 20
  • 21. JDBC and Maven • Starting with 4.10.JC8W1 • JDBC drivers are published to maven central!! • Prior work with Gradle builds makes this easier to achieve. • Most direct implementation of DevOps, continuous delivery yet for Informix • Versioning – Maven artifacts prefer semantic versioning – For JDBC we use 3 or 4 digits • Latest JDBC driver 4.10.8.1 • Next JDBC driver likely is 4.10.9 21
  • 22. JDBC and Maven • Accessing the driver is easier than ever • Bypasses hurdles with publishing through prior mechanisms http://mvnrepository.com/artifact/com.ibm.informi x/jdbc/4.10.8.1 • Link takes you to Maven’s search page with details about the driver and version • You can directly download the jar from pages like this 22
  • 23. Informix JDBC on Maven 23
  • 24. JDBC and Maven • This allows you to easily and programmatically grab the driver • Using your own Gradle, Maven, SBT to pull in latest versions of the driver • Can even use ‘curl’ or wget to pull down the file directly from the web • Can stage drivers into your own internal Maven repository 24

Notes de l'éditeur

  1. JDBC has 127K up to now 129K lines