cmd.ExecuteReader()
Download
Report
Transcript cmd.ExecuteReader()
Microsoft .NET
Gerry Miller
Chief Technology Officer
Microsoft Corporation – US Central Region
Vision
Empower people
through great software
any time, any place,
and on any device
Names And Notables
Jim Gray, 1998 Turing Award
Butler Lampson, 1992 Turing Award
C.A.R. Hoare, Turing Award, Kyoto Prize
Gary Starkweather, Inventor of the laser printer
Jim Blinn, Graphics pioneer
Jim Kajiya, Graphics pioneer
Michael Freedman, Fields Medal winner
Laci Lovasz, Wolf Prize and 2001 Godel Prize
Gordon Bell, Father of the VAX
Rick Rashid, Mach microkernel, “NUMA”
Compaq Tru64 Unix, Mac OS X
Microsoft .NET
A Platform for the Next-Gen
Internet
Vision
Platform
Services
Vision: Web Services
Web
Service
XML
Web
Service
XML
Web
Service
XML
Web
Service
“Building Block
Services”
Client
Client
XML
Vision: New Devices
Broadband
Wireless
Smart cards
Incredible PCs with
microphone, camera
Tablet PC
Pocket PC, screen phone
Adaptable, customizable UI
Framework, Languages, And Tools
VB
C++
C#
JScript
…
Common Language Specification
Windows
Forms
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System
Visual Studio.NET
ASP.NET
Web Forms Web Services
Mobile Internet Toolkit
User-Centric Web Services
.NET Inbox
.NET Alerts
.NET Calendar
.NET Application
Settings
.NET Contacts
.NET Documents
.NET Lists
.NET Categories
.NET Devices
.NET
FavoriteWebsites
.NET Location
.NET Presence
.NET Profile
.NET Wallet
A Platform For Web Services?
PC’s &
Devices
User experiences
Web services
Servers
Building The .NET Platform
PC’s and
Devices
User
experiences
.NET Programming
Web
services
Storage
Notification
Servers
Enterprise Servers
Authentication
VisualStudio.NET
.NET Framework
XML Web Services
The Integration Challenge
Partners
Customers
Customer
Customer Service
Service
Supply Chain
ERP
Employees
Human Resource
Financial Services
The TMC team spent 4 months performing this
benchmark. They worked 100 hours per week on this
and worked every weekend, skipping holidays. Trust
me, they were trying very hard to make J2EE win. But
in the end, J2EE did not come out on top.
TMC had a lot of heartache seeing the results of this
benchmark. We internally debated about whether we
should post this or not. In the end, we decided to go
forward and publish this report.
- The Middleware Group,
October 2002
Performance
Petshop Case Study
Java Pet Store is Sun’s primary blueprint
application for J2EE
Source: http://java.sun.com/j2ee/blueprints
Illustrates best coding practices for J2EE
Ships as a sample application in IBM Websphere,
Oracle Application Server 9i, Sun iPlanet, and
BEA WebLogic
The .NET Petshop is a port of the J2EE Java
Pet Store to .NET
Source: http://www.gotdotnet.com/compare
Implements the same functionality as Java Pet
Store
Illustrates best coding practices for .NET
Framework
Porting Java Pet Store to .NET
15500
14,273
Lines of Code Required
14000
.NET Petshop
11500
Java Pet Store
9000
7500
5,891
5,404
4,410
5000
2,865
2,566
710
2500
Total Lines
of Code
User
Interface
Middle Tier
761
412
74
Data Tier Configuration
Page Response Times
Based on Oracle-published data for tuned version of Java Pet Store
Using Oracle’s test scripts from their “9i App Server Challenge”
Run on equivalent hardware
Response Time (Seconds)
1.0
0.8
0.6
0.4
0.2
0
0
500
1000
1500
2000
User Load Level
2500
2750
Page Response Times
Based on Oracle-published data for tuned version of Java Pet Store
Using Oracle’s test scripts from their “9i App Server Challenge”
Run on equivalent hardware
Response Time (Seconds)
1.0
0.8
0.6
2800% Better performance
0.4
0.2
0
0
500
1000
1500
2000
User Load Level
2500
2750
Page Response Times
Based on Oracle-published data for tuned version of Java Pet Store
Using Oracle’s test scripts from their “9i App Server Challenge”
Run on equivalent hardware
Response Time (Seconds)
1.0
0.8
0.6
2800% Better performance
0.4
0.2
0
0
500
1000
1500
2000
User Load Level
2500
2750
Page Response Times
Based on Oracle-published data for tuned version of Java Pet Store
Using Oracle’s test scripts from their “9i App Server Challenge”
Run on equivalent hardware
Supporting 6 times more users
Response Time (Seconds)
1.0
0.8
0.6
2800% Better performance
0.4
0.2
0
0
500
1000
1500
2000
User Load Level
2500
2750
Broad Language Support
String s = "authors";
J#
SqlCommand cmd = new SqlCommand("select * from "+s, sqlconn);
cmd.ExecuteReader();
Broad Language Support
VB.NET
Dim s as String
s = "authors"
Dim cmd As New SqlCommand("select * from " & s, sqlconn)
cmd.ExecuteReader()
C#
string s = "authors";
SqlCommand cmd = new SqlCommand("select * from "+s, sqlconn);
cmd.ExecuteReader();
String *s = S"authors";
SqlCommand cmd = new
SqlCommand(String::Concat(S"select * from ", s),
sqlconn);
cmd.ExecuteReader();
C++
Broad Language Support
JScript
var s = "authors"
var cmd = new SqlCommand("select * from " + s, sqlconn)
cmd.ExecuteReader()
Perl
String *s = S"authors";
SqlCommand cmd = new SqlCommand(String::Concat(S"select *
from ", s), sqlconn);
cmd.ExecuteReader();
Python
s = "authors"
cmd =SqlCommand("select * from " + s, sqlconn)
cmd.ExecuteReader()
Broad Language Support
Cobol
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
REPOSITORY.
CLASS SqlCommand AS "System.Data.SqlClient.SqlCommand"
CLASS SqlConnection AS "System.Data.SqlClient.SqlConnection".
DATA DIVISION.
WORKING-STORAGE SECTION.
01 str PIC X(50).
01 cmd-string PIC X(50).
01 cmd OBJECT REFERENCE SqlCommand.
01 sqlconn OBJECT REFERENCE SqlConnection.
PROCEDURE DIVISION.
*> Establish the SQL connection here somewhere.
MOVE "authors" TO str.
STRING "select * from " DELIMITED BY SIZE,
str DELIMITED BY " " INTO cmd-string.
INVOKE SqlCommand "NEW" USING BY VALUE cmd-string sqlconn RETURNING cmd.
INVOKE cmd "ExecuteReader".
Broad Language Support
RPG
DclFld MyInstObj Type( System.Data.SqlClient.SqlCommand )
DclFld s Type( *string )
s = "authors"
MyInstObj = New System.Data.SqlClient.SqlCommand("select *
from "+s, sqlconn)
MyInstObj.ExecuteReader()
Fortran
assembly_external(name="System.Data.SqlClient.SqlCommand")
sqlcmdcharacter*10 xsqlcmd
Cmd x='authors'
cmd = sqlcmd("select * from "//x, sqlconn)
call cmd.ExecuteReader()
end
Broad Language Support
APL
s←String.New ‘authors’
cmd←SqlCommand.New (‘select * from ‘,s.ToString σ) sqlconn
cmd.ExecuteReader
Smalltalk
|s| := 'authors'.
|cmd| := SqlCommand('select * from '+s, sqlconn).
cmd.ExecuteReader().
Broad Language Support
Scheme
(let* ( (s "authors")
(cmd (new-SqlCommand (string-append "select * from " s)
sqlconn)))
(execute-command cmd))
local
s: STRING
cmd: SQLCOMMAND
Eiffel
do
s := "authors"
create cmd("select * from " + s, sqlconn)
cmd.ExecuteReader()
end
ExecuteReader = invoke System.Data.SqlClient.ExecuteReader();
SqlCommand = create System.Data.SqlClient.SqlCommand(String,\
System.Data.SqlClient.SqlConnection);
query = sqlconn -> let{ s = "authors"; } in {
cmd <- SqlCommand ("select * from "+s, sqlconn);
cmd # ExecuteReader();
};
Mondrian
You have to manage it by ignoring it. The
complexity of J2EE is pretty
extreme…There’s a dirty little secret about
J2EE; most people don’t need J2EE; the
JSPs and database APIs are enough ….If
you need to use it, then use it; if you don’t,
stay away.
- James Gosling (the
“father” of Java”), May 2002
InfoWorld: So what you're saying is
what J2EE adds in terms of Web
services support in 1.4 could be
relatively irrelevant?
Mills: Yes. That's exactly what I'm
saying.
- Steve Mills, IBM chief
software executive, April
2002
Though in theory, any J2EE
application can be deployed
on any J2EE-compliant
application server, in practice,
this is not strictly true.
- Oracle’s web site
Due to the vendor-specific tools and
extensions required for ease of
development, functionality, performance,
and integration, Java 2 Enterprise
Edition (J2EE) application servers still
lock users into a specific vendor's
product, despite being based on
standards.
- The Meta Group
The .NET Bet
Software industry transformation
Integration and XML
Decentralized computing
New user experience
User confidence in privacy, security
Windows 2000 foundation
Subscription business models
Partnerships