473,766 Members | 2,130 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Stored Procedures X Java Stored Procedures in DB2 8.2

Hi All,

We are starting a large data warehousing project using DB2 8.2 on AIX.
There is a direction to move any new internal development to Java and a
question was raised: Would it be a good idea to have all stored
procedures that we might need (ETL, additional transformers, etc) for
this project and any other project written in Java as opposed to SQL/P?
Does anyone have any number or experience in terms of performance
differences?

Regards,

Rafael Faria

Nov 12 '05 #1
2 1907
Rafael Faria wrote:
Hi All,

We are starting a large data warehousing project using DB2 8.2 on AIX.
There is a direction to move any new internal development to Java and a
question was raised: Would it be a good idea to have all stored
procedures that we might need (ETL, additional transformers, etc) for
this project and any other project written in Java as opposed to SQL/P?
Does anyone have any number or experience in terms of performance
differences?

It depends.
I would _not_ use Java in any environment with high throughput.
That is Java UDF in queries with many rows or Java Procs for high
through in e.g. batch processing.
Using Java to drive your complex queries (Read: it's not the Java that
takes time it's the SQL) is no problem.
SQL Procedures are faster than Java today and they will only get faster
from release to release.
So if your SQL in the procs takes minutes to run, the choice of language
for logic is irrelevant.
If you drive a lot of logic in your ETL and the SQL is trivial the
choice of language is everything.

Just my 2 cents canadian
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
I tend to summarize procedures this way: use the strengths of the language.

LANGUAGE SQL should always be the first choice; if you can use the
mechanism inside that language to do what you want to do, then it will
not only give you the best performance, but it is also the easiest to
maintain and port from system to system (no external files to worry
about, just the DDL). It's a fairly straightforward language to learn,
as it's not that much more complex than the SQL statements it will be
executing.

However, there are operations that that language can't do, such as
accessing files, opening TCPIP ports, etc. In that case, it's really a
matter of choice what EXTERNAL (ie, accessing an external library)
language you use. JAVA would probably be fine in this case, as it's
object structure tends to encapsulate complex functionality quite well,
and it's probably the second most portable language behind SQL, as you
can use the "SQLJ"-schema'ed functions (I won't describe them here --
they're documented quite well online) to manage your JAR files and
ensure changes are picked up on the server. However, most SQL inside of
JAVA procedures is dynamically executed, which can hinder performance,
and can require some configuration (picking a JDK, ensuring the files
required can be access, setting the JAVA_HEAP_SZ) in order to get the
best results.

Really, though, if you can't use LANGUAGE SQL I'd use whatever language
you're comfortable coding in.

Rafael Faria wrote:
Serge Rielau wrote:
Rafael Faria wrote:
Hi All,

We are starting a large data warehousing project using DB2 8.2 on
AIX.
There is a direction to move any new internal development to Java
and a
question was raised: Would it be a good idea to have all stored
procedures that we might need (ETL, additional transformers, etc)
for
this project and any other project written in Java as opposed to
SQL/P?
Does anyone have any number or experience in terms of performance
difference s?


It depends.
I would _not_ use Java in any environment with high throughput.
That is Java UDF in queries with many rows or Java Procs for high
through in e.g. batch processing.
Using Java to drive your complex queries (Read: it's not the Java


that
takes time it's the SQL) is no problem.
SQL Procedures are faster than Java today and they will only get


faster
from release to release.
So if your SQL in the procs takes minutes to run, the choice of


language
for logic is irrelevant.
If you drive a lot of logic in your ETL and the SQL is trivial the
choice of language is everything.

Just my 2 cents canadian
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Hi Serge / All,

Thanks very much for your comments. They seem to support what I
expected.
The old DW is running on Oracle on an old Unix server. The new DW is
going to be running on brand new IBM servers and on DB2 8.2 and we will
have additional feeds from new operational systems that the old DW
didn't have to handle. Therefore it's a bit hard to draw conclusions
based on the existing numbers.
At this stage, we don't anticipate any extremely sophisticated logic or
transformations on the new ETL processes. There will be a lot of data
to be moved from operational systems to the warehouse on a daily basis
though, so performance will be a very important factor.
For these reasons I'm inclined to vote against java stored procedures
at this point.
We might put together a prototype to compare both solutions just to
substantiate with numbers our decision.
Given the scenario above would you implement the Java SP using JDBC or
SQLJ?

Thanks again for any feedback.

Regards,

Rafael Faria

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3284
by: Suresh Tri | last post by:
Hi all, I am in search of any Enterprise level Opensource Project that uses Java Stored Procedures supported by Oracle. I could not find any by googling. Can any one plese point me to any such projects? Actually i'm intereseted in knowing to what extent java stored procedures are used in enterprise applications. A opensource project will let me look into the code to get better idea.
11
10757
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures execute in the database server with better performance? Please advise good references for Oracle stored procedures also. thanks!!
7
3255
by: Alex | last post by:
Hi all, I am trying to install a java stored procedure via the windows development centre. The linux box is running 8.1 FP4 as is the windoze platform. If I am on the linux box i can install the sample jdbc stored procedures o.k. For the purpose of this test I created a sample procedure that executes "select * from department" when conected to the sample database on the linux box.
3
2805
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default" when I launched the IBM Distributed Debugger via D:\IBMDebug>idebug.exe -qdaemon -quiport=8000,8001 First, a bit of background. I am running DB2 V7.2 with Fixpack 9 applied on Windows XP Professional (all critical service applied). I've written...
4
3190
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the Throwable as an OUT parameter and what datatype should I use in the CREATE PROCEDURE and DROP PROCEDURE statements? Here's what I tried: - the method signature for the stored procedure included: Throwable throwable
4
1909
by: Mike L. Bell | last post by:
As the DBA for a development project a couple of years ago, I was in charge of migrating/promoting stored procedures from the development environment to the QA and production environments once they had been proven. I automated the process with a script that sucked the source code from source database, removed proc if exsists in target environment, compiled it in the target enviroment and logged the operation in a tracking table. This...
1
2404
by: Alex | last post by:
Hi all, Just been dabbling with java stored procedures and I'm having problems replacing System: db2 8.1.4 on RH 7.1 linux system 1). Look at java jdbc samples as supplied with db2 and run the SpServer and Spclient progs against the default database SAMPLE. And everything works.
2
9244
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
2
3149
by: Michael | last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP, I am unable to find out why the "Build for Debug" option within Stored Procedure Builder is not enabled on Java stored procedures. It is enabled for SQL stored procedures. It is possible to "Build" and "Run" the Java SPs, it just isn't possible to click on the "Build for Debug" option. Thanks for any help in advance. Michael
0
9571
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.