boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 改写(migrate) stored proc 问题
相关主题
java developer学哪个好:oracle, sql server.
hibernate能不能orm没有主键的表格
哪里用NoSQL比较合适?
Web Seminar hosted by CINAOUG on 2011/06/13 (转载)
MySQL JDBC 问题
A question
搞不懂为什么hibernate为什么这么流行?
JDBC or SQL-C?
真诚求助 (JAVA校友录)
MS SQL Server JDBC Driver Problem
相关话题的讨论汇总
话题: sp话题: stored话题: java话题: sql话题: proc
进入Java版参与讨论
1 (共1页)
P*****f
发帖数: 2272
1
【 以下文字转载自 Database 讨论区 】
发信人: Pontiff (树), 信区: Database
标 题: 改写(migrate) stored proc 问题
发信站: BBS 未名空间站 (Sun Feb 1 17:04:12 2009), 转信
现在有一特长控制流程较复杂的MS SQL Server SP 需要改写.
简单来说就是使用标准的JDBC SQL,不使用Stored Procedure.
这样一来,似乎:
1.复杂的控制流程只能在客户端的Java代码实现
2.需要多次(执行SQL/处理结果)的iteration.似乎这样性能会比使用SP降低不少?
any comments are welcomed. thx
c*****t
发帖数: 1879
2

其实区别也不是太大。基本上除了个别 function,比如 aggregate, simple
evaluation function 之外,其它在 server 和在 client 上的 code 基本上
差不多。
server procedure 的主要优点就是不需要 transfer data,也不需要 convert
data (endian 问题)。所以 overhead 少很多。

【在 P*****f 的大作中提到】
: 【 以下文字转载自 Database 讨论区 】
: 发信人: Pontiff (树), 信区: Database
: 标 题: 改写(migrate) stored proc 问题
: 发信站: BBS 未名空间站 (Sun Feb 1 17:04:12 2009), 转信
: 现在有一特长控制流程较复杂的MS SQL Server SP 需要改写.
: 简单来说就是使用标准的JDBC SQL,不使用Stored Procedure.
: 这样一来,似乎:
: 1.复杂的控制流程只能在客户端的Java代码实现
: 2.需要多次(执行SQL/处理结果)的iteration.似乎这样性能会比使用SP降低不少?
: any comments are welcomed. thx

t*******e
发帖数: 684
3
This is a highly debatable issue. It boils down to a very basic question,
where do we place the business logic, in Java code or in stored proc. You
get the benefits of OO programming paradigm by using Java. while DBAs will
surely disagree on that. In doing so, you have to face the challenges of
handling transactions and performance by yourself. I would say let DBAs
write SP if you are not very confident with your skills or business
knowledge.
g*****g
发帖数: 34805
4
It all depends on the logic. Personally, I would recommend using SP
for long lasting data processing process, e.g. if you generate a
statement midnight every night based on heavy computation of data,
then SP is preferred. In most other cases, we prefer using an
Object-Relational mapping to simplified development. Also, application
server is easy to cache and scale, doing that on database would be
much more expensive. Most system have bottleneck on database, and you
don't want to impose more burd

【在 t*******e 的大作中提到】
: This is a highly debatable issue. It boils down to a very basic question,
: where do we place the business logic, in Java code or in stored proc. You
: get the benefits of OO programming paradigm by using Java. while DBAs will
: surely disagree on that. In doing so, you have to face the challenges of
: handling transactions and performance by yourself. I would say let DBAs
: write SP if you are not very confident with your skills or business
: knowledge.

P*****f
发帖数: 2272
5
多谢几位的讨论

,
You
will

【在 g*****g 的大作中提到】
: It all depends on the logic. Personally, I would recommend using SP
: for long lasting data processing process, e.g. if you generate a
: statement midnight every night based on heavy computation of data,
: then SP is preferred. In most other cases, we prefer using an
: Object-Relational mapping to simplified development. Also, application
: server is easy to cache and scale, doing that on database would be
: much more expensive. Most system have bottleneck on database, and you
: don't want to impose more burd

1 (共1页)
进入Java版参与讨论
相关主题
MS SQL Server JDBC Driver Problem
JDBC & Firewall
请教高手一个JDBC的问题!
我只能抗议OracleJDBC了!: 请教一个关于JDBC的问题,实在太烦了!
HELP! SQL Server vs JDBC question
Re: SQL Server 2000 Driver for JDBC - Er
JDBC如何获取新加入的记录的索引
a question regarding JDBC driver?
Hibernate question
oracle help: pass array to oracle SP
相关话题的讨论汇总
话题: sp话题: stored话题: java话题: sql话题: proc