Weird Stuff I Saw While ... Supporting a Java Team

Slides:



Advertisements
Similar presentations
High level QA strategy for SQL Server enforcer
Advertisements

© 2012 Entrinsik, Inc. Informer Administration Exploring the system menu and functions PRESENTER: Jason Vorenkamp| Informer Software Engineer| March 2012.
11-Jun-14 The assert statement. 2 About the assert statement The purpose of the assert statement is to give you a way to catch program errors early The.
MC365 JDBC and Server-Side Programming: Updating a database via JDBC & Connection Pooling.
1 JDBC Java Database Connectivity. 2 c.pdf
1 - Oracle Server Architecture Overview
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
Advance Computer Programming Java Database Connectivity (JDBC) – In order to connect a Java application to a database, you need to use a JDBC driver. –
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 12 1 Microsoft Office Access 2003 Tutorial 12 – Managing and Securing a Database.
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
Stored procedures1 Stored procedures and functions Procedures and functions stored in the database.
Effective Test Driven Database Development Gojko Adzic
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
JDBC Java and Databases. RHS – SOC 2 JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Object-Oriented Principles Applications to Programming.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
IT System Administration Lesson 3 Dr Jeffrey A Robinson.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Function, Trigger used in PosgreSQL.
1 Database Programming with ADO.NET Kashef Mughal.
JDBC Java and Databases. SWC – JDBC JDBC – Java DataBase Connectivity An API (i.e. a set of classes and methods), for working with databases in.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
JDBC.
CS320 Web and Internet Programming Database Access with JDBC Chengyu Sun California State University, Los Angeles.
Enterprise Java Beans. Contents  Understanding EJBs  Practice Section.
Chapter 12 Introducing Databases. Objectives What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and.
ASP.NET Programming with C# and SQL Server First Edition
DEPTT. OF COMP. SC & APPLICATIONS
Running a Forms Developer Application
JDBC Database Management Database connectivity
Data Virtualization Tutorial… OAuth Example using Google Sheets
CS320 Web and Internet Programming Database Access with JDBC
Java Programming Language
Database Systems: Design, Implementation, and Management Tenth Edition
Testing and Debugging.
Error Handling Summary of the next few pages: Error Handling Cursors.
Weird Stuff I Saw While ... Supporting a Java Team
Auditing in SQL Server 2008 DBA-364-M
ECONOMETRICS ii – spring 2018
Weird Stuff I Saw While ... Supporting a Java Team
WEB API.
Principles of report writing
ISC440: Web Programming 2 Server-side Scripting PHP 3
When I Use NOLOCK AND OTHER HINTS
Agenda Database Development – Best Practices Why Performance Matters ?
James Blankenship March , 2018
Query Optimization Techniques
Why Should I Care About … Partitioned Views?
Interacting with Database
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Weird Stuff I Saw While ... Supporting a Java Team
Microsoft Office Access 2003
When I Use NOLOCK AND OTHER HINTS
Weird Stuff I Saw While … Working With Heaps
When I Use NOLOCK AND OTHER HINTS
Chapter 11 Managing Databases with SQL Server 2000
A – Pre Join Indexes.
SQL Server Security 101 How did you get in here, and
Query Optimization Techniques
Azure SQL Database Lessons Learned From the Trenches Best practices, Tips and Tricks on monitoring and improving performance. Fernando Cobo.
Responding to Data Manipulation Via Triggers
Presentation transcript:

Weird Stuff I Saw While ... Supporting a Java Team Rick Lowe rick@data-flowe.com @dataflowe Rick’s Upcoming eLearning Courses Performance Monitoring – July 27 MSSQL on AWS – August 9 Code that Kills Performance – Sep 13

What I’m Not I am not a Java Expert I deny that I’m a developer Probably not especially knowledgeable about using MSSQL from Java … I am interested in starting a conversation about these issues 2 | 10/10/2015 Session Title Here

Example 1 : Looking for the cache 3 | 10/10/2015 Session Title Here

SelectMethod Options “SelectMethod = full” : client retrieves entire result set “SelectMethod = cursor” : server side cursor “responseBuffering=adaptive” : Results retrieved as they are needed Some are unaware of adaptive buffering. Adaptive buffering is default in JDBC 2.0 and later 4 | 10/10/2015 Session Title Here

Server Side Cursors Works much like a normal cursor Cursor is created from a query and opened Results are read back row-by-agonizing-row Every single one of these steps involves a trip across the network One row at a time minimizes memory requirements on the client 5 | 10/10/2015 Session Title Here

Removing server side cursors Not just annoying - potential performance issue In recent JDBC versions, simply remove “SelectMethod=cursor” from URL Evaluate on test system first Workloads do exist where cursors are appropriate from a client side perspective 6 | 10/10/2015 Session Title Here

Example 2 : Conversion to CRUD 7 | 10/10/2015 Session Title Here

How things work in ADO.Net try { mySqlCommand.executeUpdate(); } catch …. executeUpdate() is not actually void, it returns # of rows impacted. … except we usually use NOCOUNT which means the return is always 0 And errors are more interesting than counts 8 | 10/10/2015 Session Title Here

How things work in Java PreparedStatement.executeUpdate() returns the number of rows impacted … and it often actually gets paid attention to When inserting, often check for return == 1 Quick fix is to remove “SET NOCOUNT ON” from Create stored procedures 9 | 10/10/2015 Session Title Here

Example 3 : OUTPUT parameters 10 | 10/10/2015 Session Title Here

It all seemed so easy… PreparedStatement.executeUpdate() will not allow you to simply ignore parameters PreparedStatement does not understand output parameters Must use PreparedCall instead To add confusion, there’s a new weird syntax you can use 11 | 10/10/2015 Session Title Here

Windows Authentication Doesn’t work. Just kidding, it works. It just doesn’t work by default. Setup depends on version 12 | 10/10/2015 Session Title Here

Prior to JDBC 4 Copy sqljdbc_auth.dll from <jdbc>\sqljdbc_version\<language>\auth\<arch> to windows\system32 Be sure to grab the correct architecture – x86 vs x64 Then integratedSecurity=SSPI will work as expected. Alternately, use the –Djava.library.path 13 | 10/10/2015 Session Title Here

Starting With JDBC 4 Can still use sqljdbc_auth Alternately, can use Java Kerberos authenticationScheme=JavaKerberos integratedSecurity=true Must now specify FQDN for server name 14 | 10/10/2015 Session Title Here

V1 Enterprise Java Beans Enterprise Java Beans help encapsulate DB code Developers implement methods to Create, Update, and Delete records Called automatically as code works with objects Issue with early versions – update method can be called whether or not data changes 15 | 10/10/2015 Session Title Here

The Talk 16 | 10/10/2015 Session Title Here

Query Hints In .Net shops, the NOLOCK wars rage on Abusing hints is a bad habit … … So we shouldn’t expect that getting folks to stop using NOLOCK just because we tell them the 101st time. We usually settle for making our personal sandbox a “no smoking zone” 17 | 10/10/2015 Session Title Here

Query Hints Contd. Java people typically aren’t used to the Microsoft stack This may be a new discussion for them There is still room to change habits in this community 18 | 10/10/2015 Session Title Here

University of Nebraska at Omaha Special thanks to UNO and the College of Business Administration for this awesome facility!

Sponsors