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

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
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.
2009 Architecture Plan Overview 2009 Architecture Plan Overview.
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.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
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.
CS178 Database Management “JDBC”. What is JDBC ? JDBC stands for “Java DataBase Connectivity” The standard interface for communication between a Java.
Beginning Databases with JDBC Mike Bradley Adapted from and notes by Kevin Parker, Ph.D.
Active Server Pages ASP is Microsoft’s server-side script engine for dynamically-generated web pages. Most common language used is VBScript. If you use.
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
MIS 3023 Business Programming II Professor: Akhilesh Bajaj Introduction to JDBC © Akhilesh Bajaj, All Rights Reserved.
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.
JDBC. Java.sql.package The java.sql package contains various interfaces and classes used by the JDBC API. This collection of interfaces and classes enable.
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.
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.
Recent Enhancements to Quality Assurance and Case Management within the Emissions Modeling Framework Alison Eyth, R. Partheepan, Q. He Carolina Environmental.
Module Road Map The Scope of the Problem A range of potential problems Lost Updates User A reads a record User B reads the same record User A makes changes.
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.
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
Boots Cassel Villanova University
Are You There, DBA? It’s Me, The App Developer.
Data Virtualization Tutorial… OAuth Example using Google Sheets
CS320 Web and Internet Programming Database Access with JDBC
Weird Stuff I Saw While ... Supporting a Java Team
Testing and Debugging.
OpenStorage API part II
Error Handling Summary of the next few pages: Error Handling Cursors.
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
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
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms
Query Optimization Techniques
Presentation transcript:

Weird Stuff I Saw While ... Supporting a Java Team Rick Lowe rick@data-flowe.com @dataflowe

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 imapacted. … 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