由买买提看人间百态

topics

全部话题 - 话题: cursor
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
c***c
发帖数: 6234
1
来自主题: Database版 - 关于not closed cursor的请教
standalone mode should be fine because the DBA did not report cursor issue
in previous load test
I will add conn.rollback in DB close function to make sure cursor closed
俩孩子长大了吧。好久不见。Arsura据说海归了,找不到他了。
我们应该使用connection pool的。前面的group lead在getConnection的try/catch 的
catch里放了普通的connection function (我们用于local debug用的)。他在get
connection里有个typo,造成4年来我们一直用connection string来setup connection
。从没测试过connection pool。
我两年前变成的lead,全面负责这个项目。10月中旬我才发现这个问题,我也一直担心
max cursor open issue,但4年都没事儿就放心了。
原来的lead step do... 阅读全帖
c***c
发帖数: 6234
2
来自主题: Database版 - 关于not closed cursor的请教
我写java。使用了大量的Stored Procedure。很多是open cursor,return java一个
list。
同组另一个人只会一般query,也只用一般statement。现在测试发现,每个session 有
30-40个 held unclosed cursor。
我们都是确保在使用cursor fetch data 后,都close resultset 和statement的
会不会cursor从一般query来的?
难道不能使用SP的 out parameter 是cursor?我这么用了10年了,一直没问题。很疑惑
code类似
stmPersonMaster.registerOutParameter(5, OracleTypes.CURSOR);
stmPersonMaster.execute();
rs = (ResultSet) stmPersonMaster.getObject(5);
while(rs.next()){
rs.getString(colName)
}
rs.close
stmPersonMaster.close
谢谢
g*******0
发帖数: 127
3
I would like to have a QLineEdit that can display a cursor position when it
is not focused. Something like the Linux terminal window - when it is
focused, the cursor becomes active (black square) and start to blink; when
it is not focused, the cursor becomes a white square with black edge.
However, by default the QLineEdit does not display any cursor when not be
focused.
Anyone has the experience on how to display a cursor in QLineEdit when it is
not focused?
l******9
发帖数: 579
4
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
c***c
发帖数: 6234
5
来自主题: Java版 - Open Too Many Cursor Issue
我们测试app。发现一个session会有80-90个cursor open。这是以前architect设计的。
我查了下,发现了有问题的query(就是简单的 select statement)。交给设计者改正
。他说是因为在for loop 里call了同样query。虽然每次DB function call,我们都
close resultset 和 statement (没有close connection)
他写的DB function 极其复杂。我没有时间仔细debug,看着没错。他说open too many
cursor 是因为每次 select 后,conn没有commit 或rollback。造成cursor一直open
,直到最后close connection。
难道java里如果select 在loop 里必须每次commit 或rollback?
如果这样,如果我用transaction 来update DB,岂不是要么open too many cursors,
要么不能rollback?
谢谢帮助
M**********n
发帖数: 432
6
来自主题: Linux版 - GTK cursor (转载)
【 以下文字转载自 Programming 讨论区 】
发信人: ManshengChen (像琼瑶一样老去), 信区: Programming
标 题: GTK cursor
发信站: BBS 未名空间站 (Tue Jan 25 10:50:51 2011, 美东)
I have a question on GTK cursor.
For example, I have a text entry and a text view within the same window. I
set both the entry and view non-editable. It appears that the cursor is
always in the text entry. How could I put the cursor in the text view
without using the mouse clicking? I have tried gtk_text_view_place_cursor_
onscreen(), but it dosn't work?
Could ... 阅读全帖
l******9
发帖数: 579
7
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
l******9
发帖数: 579
8
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL run a stored procedure by fetching from a cursor row by row
发信站: BBS 未名空间站 (Fri May 23 17:57:23 2014, 美东)
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id A... 阅读全帖
a*****i
发帖数: 4391
9
来自主题: Database版 - cursor可以往回找否??

hmm if I were you, I would probably fetch the cursor into a record first
time when cursor is being processed.
You can't traceback in cursor processing.
t******t
发帖数: 51
10
来自主题: Database版 - Help: Too Many Cursors in Oracle!!
I use JDBC to send CLOB objects to the database from my web application.
However, I quickly get a large number of dangling cursors. I searched the
cursor table and it shows it has a whole bunch of the following cursors open:
begin dbms_lob.trim (:1, :2); end;
I don't think I explicitly run the above script in my application. Where do I
get this? I do use oracle.sql.CLOB.trim() in my application (Java) code. Is it
related to the dbms_lob.trim thing?
Any suggestions are appreciated.
l******9
发帖数: 579
11
I need to run a stored procedure on SQL server 2008.
But, I can only fetch one row from the cursor. After that, the @@FETCH_
STATUS is -1.
DECLARE @my_table TABLE
(
code int not null
);
INSERT INTO @my_table (id)
SELECT DISTINCT a.id
FROM table1 as a
WHERE a.value = 'abc'
ORDER BY a.id ASC
DECLARE t_input CURSOR FOR
SELECT id
FROM @my_table
DECLARE @return_value tinyint
DECLARE @my_id varchar(3)
OPEN t_input
FETCH NEXT FROM t_input... 阅读全帖
w*r
发帖数: 2421
12
来自主题: Database版 - 关于not closed cursor的请教
I do not think oracle jdbc closes cursor just because you close resultset or
statement. The cursor will remain open until the connection is closed. If
your application is expecting to use connection pool and reuse connection,
then you might want to issue commit after resultset is fully processed. Give
that a shot. If you keep getting the ORA error with maximum cursor limit,
you can temporary elevate your number of open_cursors in the ora.ini file..
however, that will not solve your problem if yo... 阅读全帖
s**********o
发帖数: 14359
13
来自主题: Database版 - 关于not closed cursor的请教
SP里为什么会大量使用CURSOR?除非一定要LOOP THROUGH一批RECORDS
SP里是不应该用CURSOR的,SQL的优势就在于SET操作速度块
CURSOR速度慢而且容易出错
c***c
发帖数: 6234
14
来自主题: Database版 - 关于not closed cursor的请教
不是SP里使用ref cursor来 loop。是out parameter 用ref cursor
难道前台无法close cursor?
w******e
发帖数: 2
15
来自主题: Java版 - 请教Cursor的问题
偶作了一个EVENT 的RECORDER 记录所有发生的EVENT, 当偶重放时,希望除了缺省的鼠
标Cursor外,有一个虚拟的鼠标Cursor能够反映以前发生的EVENT的位置。就象有些DEMO
里的鼠标器提示一样。请教各位大侠,怎么作那个虚拟的鼠标Cursor.
谢谢。
c*****t
发帖数: 1879
16
来自主题: Java版 - big paintbrush cursor?
Anyone knows how to create big paint cursor like those in Photoshop
in Java?
Basically, user can choose the brush size, so the mouse cursor gets
bigger. When user zooms in, the brush also gets bigger. The shape
of the cursor depends on the brush type used.
Anyone knows how to do it in Java?
Thanks
s*******y
发帖数: 558
17
Is there any way to hide the cursor in JTextField and show the
cursor when I click this field? It'd be great if I click other area
or components in the panel, hide the cursor in the JTextField again.
Thanks a lot.
D******y
发帖数: 3780
18
来自主题: Linux版 - Cursor Position in bash prompt
CentOS 5.3 64bit
I set export PS1="\[$(tput setaf 2)\]\u@\h:\w # \[$(tput sgr0)\]" in my .
bashrc
if I press enter without any commands, the cursor will move it to the middle
of the prompt like the following:
root@server [cursor] /var/lib/mysql #
if I input any command and press enter, the cursor will be at the correct
position.
if I don't set any color prompt, everything is good.
Anyone knows why? Thankssssssss
M**********n
发帖数: 432
19
来自主题: Programming版 - GTK cursor
I have a question on GTK cursor.
For example, I have a text entry and a text view within the same window. I
set both the entry and view non-editable. It appears that the cursor is
always in the text entry. How could I put the cursor in the text view
without using the mouse clicking? I have tried gtk_text_view_place_cursor_
onscreen(), but it dosn't work?
Could someone give any suggestions?
b****e
发帖数: 985
20
来自主题: BuildingWeb版 - cursor positioning?
dhtml/javascript的问题
我有一个textarea,
如何找到里面cursor的位置?
比如,我按一个button,
就在cursor的位置后面加一个字,
该怎么做?
c***c
发帖数: 6234
21
来自主题: Database版 - 关于not closed cursor的请教
谢谢啊
MLGB的,才和DBA聊完。
所有open cursor都是从query来的,没一个从我的stored procedure里来的。是原来的
老code。这帮人在 for loop 里execute query。不close resultset。仅仅在finally
里close resultset。
我觉得是这个原因。
所以,close resultset确实close cursor。
r***e
发帖数: 2000
22
来自主题: Linux版 - mouse cursor hard to find
After upgrading to Fedora 21, the mouse cursor is
very hard to find. Is there a place to set the
shape/size of the cursor, and how fast it blinks?
Thank you.
c**********s
发帖数: 2
23
来自主题: Unix版 - how to change the speed of cursors?
Daxiamei:
How can I change the speed of the cursors? I am using xwin3.2. Whenever I
change to Unix interface, the cursor moves very slowly.
any idear?
Thanks a million
c*****a
发帖数: 177
24
来自主题: shopping版 - T420打字过程中cursor不稳定
刚买的T420现在发现有时打字过程中cursor会莫名奇妙跳到别的地方去,大家遇到过类
似情况么?
k****t
发帖数: 12697
25
来自主题: PhotoGear版 - PS 的CURSOR 咋改不过来了?
CLONE STAMP 俺一直用个跟SIZE 一样大的圆圈, IT 现在自说自话的变成 CROSSHAIR,
在PREPFERENCE > DISPLAY & CURSORS 里咋整都改不过来.
PS 大妞?
c******n
发帖数: 4965
26
I'm attaching a larger LCD to my mac, and extend the screen to both displays
but I somehow messed with something, and now the cursor is limited to only
one screen, and can't be moved across, what might be wrong?
Thanks
a****r
发帖数: 154
27
来自主题: Database版 - cursor可以往回找否??
working on a project: using server side javascript to do a
database query.
the output page will show 5 records one time with a "less" and a
"more" button. When user clicks "more" button, i can use cursor.next()
to get the next 5 records. But how can i return back to previous 5
records if user clicks "less" button without querying database again?
Any ideas?
多泄了.
S*******s
发帖数: 13043
28
来自主题: Database版 - can I create a recordset with cursor?
what I want to is like this:
declare @acc int,@id int,@count int
decalre my_cursor cursor for
select id, count from sometable
set @acc=0
open my_cursor
fetch next from my_cursor
into @id,@count
while @@fetch_status=0
begin
@acc=@acc+@count
-- i want to insert a new raw to the recordest returned, but how?
insert_to_recorset @id,@acc
fetch next from my_cursor
into @id,@count
end
close my_cursor
deallocate my_cursor
u****s
发帖数: 107
29
写了个函数实现输入一个title_id参数,查询到另外两个参数v_btitle和v_pname放在游
标里.
编译通过,但运行出错.
请问哪里不对?着急啊,跪求高人指教.
create or replace package types as
type mytype is ref cursor;
end;
create or replace function get(title_id VARCHAR2)
return types.mytype is
cursor_bp types.mytype;
sqlstr varchar2(4096);
v_btitle VARCHAR2(30);
v_pname VARCHAR2(30);
begin
sqlstr :='SELECT title,name
FROM books JOIN publisher using(pubid)
WHERE isbn = :tit
B*****g
发帖数: 34098
30
1. When you ask oracle question, let us know your oracle version.
2. When you see an error, let us know the error message.
3. You create a function, but you did not return any value from your functio
n.
4. You have a binding variable in your cursor, but I do not see anywhere you
bind the value. try "open cursor_bp for sqlstr using title_id".
5. If still not work, post again.
c**t
发帖数: 2744
31
来自主题: Database版 - open cursor for collection?
the way comes on top of my head is:
declare sql_stmt varchar2(30000);
begin
for i in myCollectionOfObject.First..myCollectionOfObject.LAST
LOOP
sql_stmt := sql_stmt || ConstructSQL( myCollectionOfObject(i) );
END LOOP;
open cursor for sql_stmt;
end;
any better way?
c***c
发帖数: 6234
32
来自主题: Database版 - 关于not closed cursor的请教
我们是用connection pool。也严格地close rs,stm 和conn。按照这个顺序close
connection 设成autocommit=true。
难道还需要commit一下?我可以rollback一下,以免麻烦产生。
你的意思是用connection pool 最好out_paramter别用ref cursor。这样我前台的list
全需要prepare select query。或者别用stored procedure。
问题是我们的select需要大量检查,全java做hit DB次数很多。
我们有close DB function。我在close function里conn.close() 前加个conn.
rollback看看
谢谢兄弟了

or
Give
.
commit.
w*r
发帖数: 2421
33
来自主题: Database版 - 关于not closed cursor的请教
What app you are using ? Are u using Any framework to manage connection pool
.? I believe the issue with cursor was long time ago. You can do simple test
to refactor ur code to standalone mode and test the behavior by ripping it
out of any framework or app server which manages connection pool. Also,
register ur close method in final block to avoid unexpected exceptions . I
wish I can help more only if I am still work in the same city as yours. Btw,
how r u recently? Did u change from sql server... 阅读全帖
c***c
发帖数: 6234
34
来自主题: Database版 - Open Too Many Cursor Issue
java
在loop里重复call 一个简单的select query。每个loop都close resultset 和
statement。
如果在每个loop里不call conn.commit或 rollback,cursor会一直open知道 close
connection吗?
谢谢
f***s
发帖数: 1582
35
上个月在Costco买了个Dell Inspiron 15 Laptop, Intel® Core™ i5-3210M
2.5GHz.Windows 8.文字输入的时候Cursor经常乱跳。有的时候字母出现又消失,需要
按住键几秒才行,非常的annoying.问过一些朋友,好像这个现象在新电脑里很普遍。
求经验和建议。谢谢了。
j***n
发帖数: 301
36
Do u mean caret by cursor? If so, maybe u can add some listener and use JTex
tField.getCaret().setVisible(false)
F*******i
发帖数: 190
37
One more question :)
Is there any way to scroll the window and keep the cursor postion relatative
to window un-changed?
Thanks again!
F*******i
发帖数: 190
38
Thanks a lot.
After adding these two lines.
Ctrl-e and Ctrl-y will works as expected.
BTW: my original mapping
" map
will not work any more after adding these two lines.
Is the any way to use Ctrl-X to achive the goal and still use Ctrl-E as End?
Also, is there any way to config Ctrl-F/Ctrl-B and keep cursor position
unchanged?
thanks again!
w*****3
发帖数: 8
39
来自主题: Linux版 - block cursor in vim
how to get block cursor in vim ?
inside screen ?
t**********h
发帖数: 100
40
来自主题: Security版 - how to Switch cursor in IBM laptop.
The arrow on my cursor has a "switch or scroll" looking device pop up under
it from time to time. It is the little black arrows that point up and one
points down in a small circle.
It is very annoying and I want to know if I can turn that feature off.
h**********r
发帖数: 174
41
来自主题: Unix版 - vim cursor position
【 以下文字转载自 Apple 讨论区 】
发信人: hunterkiller (雨下整夜), 信区: Apple
标 题: vim cursor position
发信站: BBS 未名空间站 (Fri Jul 27 15:16:04 2007), 转信
以前在unix上用vi, 每次打开vi a.c, 光标都回到上次保存退出时的位置. 很方便.
这个功能怎么设置的? 我现在在OS X上用vim, 每次打开光标都在文件开始. :(
e*n
发帖数: 1511
42
【 以下文字转载自 Stock 讨论区 】
发信人: mitbbs2020 (bbc), 信区: Stock
标 题: Re: 【Stragety论坛】Trading with correlations.
发信站: BBS 未名空间站 (Sun Jul 25 19:52:04 2010, 美东)
用option当然可以,但不是必须,
用option可以得到更高的leverage,
但是缺点是散户量小,不容易实现market neutral。
比如1.37的hedge ratio,你要long 137和short 100个才能实现。
13和10就不那么好,而且不容易adjust,看附图就知道不怎么neutral的情况。
说stock不便于对冲,这点我不懂你什么意思。
这本身就是market neutral的strategy。
我测试过DISCA和AXP(paper account),追踪了至少2个月,涨跌幅从来没超过3%的,
但是这反过来说明这不是一对好的pair。
别的pair,没有任何leverage,一年可以做到100%以上的也有,如果我实际做stock到
这个%,
已经很满意了... 阅读全帖
s******n
发帖数: 3946
43
来自主题: JobHunting版 - 感恩发面经-Amazon第三轮电面
用一个List存放当前Open的XML tag。
每来一个数组,假设0~i匹配List的0~i,首先要关闭List里面i后面的所有tag,然后再
Push新来数组的i后面的所有Tag到List后面
所有数组跑完后再关闭List上所有的Tag
List temp;
String [][]input;
for (int i=0; i String[] sentence = input[i];
int cursor;
for (cursor=0; cursor +) {
if (!sentence[cursor].equals(temp[cursor]) break;
}
int closeTags = 0;
for (int j=temp.length()-1; j>=cursor; --j) {
printf("");
... 阅读全帖
s******n
发帖数: 3946
44
来自主题: JobHunting版 - M家 onsite 悲剧,同胞们弄死烙印吧
if (head==NULL || head->next==NULL) return head;
Node* newhead = head->next;
Node* last = NULL;
Node* cursor = head;
while (cursor && cursor->next) {
Node* newposition = cursor->next->next;
if (last!=NULL) last->next = cursor->next;
cursor->next->next = cursor;
last = cursor;
cursor = newposition;
}
if (last!=NULL) last->next = cursor;
return newhead;
s******n
发帖数: 3946
45
来自主题: JobHunting版 - M家 onsite 悲剧,同胞们弄死烙印吧
if (head==NULL || head->next==NULL) return head;
Node* newhead = head->next;
Node* last = NULL;
Node* cursor = head;
while (cursor && cursor->next) {
Node* newposition = cursor->next->next;
if (last!=NULL) last->next = cursor->next;
cursor->next->next = cursor;
last = cursor;
cursor = newposition;
}
if (last!=NULL) last->next = cursor;
return newhead;
z******g
发帖数: 271
46
来自主题: JobHunting版 - VMWARE 的在线测试题一个
#include
#include
#include
typedef struct trie {
int count;
const char *start;
int len;
struct trie *children[256];
} trie;
static inline trie *make_trie_node(const char *start, int len) {
trie *t, temp = {
.start = start,
.len = len
};
t = malloc(sizeof(trie));
memcpy(t, &temp, sizeof(trie));
memset(&t->children, 0, sizeof(t->children));
return t;
}
const char *most_frequent_substr(const char *str, int k, in... 阅读全帖
a*****p
发帖数: 1285
47
来自主题: Java版 - java graphics2d 画图请教
public class MouseComponent extends JComponent {



public MouseComponent() {

shapes = new ArrayList();
lines = new ArrayList();
bounds = new ArrayList();
current = null;
startpoint = null;
endpoint = null;

isSelected = false;
eraserSelected = false;
cursorPointer = false;
isLine = false;
clear = false;
filled = false;

shapeIndex =... 阅读全帖
h*******3
发帖数: 3775
48
这几个问题是有关汇编语言移动光标的问题,大家能不能看看我做的对吗?
谢谢啦。
Write some code to do the following (assume 80x25 monochrome display, page 0
.)
Each part of this problem is independent of the other parts.
a)Move the cursor to the upper left corner of the screen.
mov ah,2 ;move cursor functin
xor bh,bh ;page 0
mov dx,0000h ;row 0,column 0
int 10h ;move cursor
b)Locate the cursor and move it to the top of the current column.
mov ah,3 ;get cursor location
xor bh,bh ;page 0
mov dh,0 ;top of current ... 阅读全帖
w******t
发帖数: 16937
49
来自主题: Living版 - 想设计个logo
分特,想看专业的?
看这个。声明:因为网络安全原因,我删去了一些必须删去的内容。
http://schema.org/WebPage">Google