cursor

Calling Oracle stored procedures with MyBatis

五迷三道 提交于 2019-12-04 07:47:17
I am in the process of moving our database over to Oracle from SQL Server 2008 but cannot get MyBatis to work. Given the following example: UserMapper.xml (example) <resultMap type="User" id="UserResult"> <id property="userId" column="userId"/> <result property="firstName" column="firstName"/> <result property="lastName" column="lastName"/> </resultMap> <select id="getUsers" statementType="CALLABLE" resultMap="UserResult"> {CALL GetUsers()} </select> UserDAO.java public interface UserDAO { public List<User> getUsers(); } SQL Server procedure CREATE PROCEDURE [dbo].[GetUsers] AS BEGIN SET

Chrome extension custom cursor

和自甴很熟 提交于 2019-12-04 07:30:51
I building an Google Chrome extension that place some IMG tag in sites. This img tag on :hover must show a custom cursor. The extension uses jQuery as its injected core script. I tried the following methods: 1. var cursor = 'url('+chrome.extension.getURL('icons/cursor.cur')+')'; $('#myImgId').css({ 'position': 'absolute', 'top':'5px', 'left':'5px', 'cursor':cursor }); This is the best working. On smaller sites its shows the cursor. On slower loading sites it does not. But on little sites it fails sometimes. 2. var cursor = 'url('+chrome.extension.getURL('icons/cursor.cur')+')'; $('<style>

Building a pagination cursor

戏子无情 提交于 2019-12-04 07:16:54
I have activities that are stored in a graph database. Multiple activities are grouped and aggregated into 1 activity in some circumstances. A processed activity feed could look like this: Activity 1 Activity 2 Grouped Activity Activity 3 Activity 4 Activity 5 Activities have an updated timestamp and a unique id. The activities are ordered by their updated time and in the case of a grouped activity, the most recent updated time within its child activities is used. Activities can be inserted anywhere in the list (for example, if we start following someone, their past activities would be

Android - Getting database ID from ListView selection

自古美人都是妖i 提交于 2019-12-04 07:11:13
问题 I have a ListView lv which uses a Cursor c from an SQL database to populate it. When an item is selected however, I need to get the ID of the row. How can I do this? 回答1: I assume that you are using a SimpleCursorAdapter (or similar), so I would use the OnItemClickListener: listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // id references the SQLiteDatabase _id column } }); 回答2: Here's how

How Can I avoid using Cursor for implementing this pseudo code - SQL Server

好久不见. 提交于 2019-12-04 06:38:39
问题 CREATE PROCEDURE p_processDataFor @accountId BEGIN for each item in (select * from Accounts where accountId = @accountId and isProcessed = 0) BEGIN CASE current row WHEN has x Condition THEN exec p_x <Pass all data of current row> WHEN has y Condition THEN exec p_y <Pass all data of current row> WHEN has z Condition THEN exec p_z <Pass all data of current row> END END END 回答1: Okay, this example only does the insert for condition X, but hopefully shows you the way you could proceed: create

cursor to update a row with values from the previous and current rows

别等时光非礼了梦想. 提交于 2019-12-04 06:33:49
Fellow Query Writers, I have a table as follows: myTable t1 col2 col3 2 1 3 0 4 0 5 0 6 0 and I want to update each zero on col3 with the value of col3 in the previous row plus the value of col2 in the current row. So my table would de like the following: myTable t1 col2 col3 2 1 3 4 (1+3) 4 8 (4+4) 5 13 (5+8) 6 19 (6+13) I'm missing the logic here, short-sightedness perhaps. I was trying it with a cursor as follows: DECLARE @var3 FLOAT DECLARE cursor3 CURSOR FOR SELECT col2, col3 FROM table1 FOR UPDATE OF col3 OPEN cursor3 FETCH FIRST FROM cursor3 WHILE (@@FETCH_STATUS > -1) BEGIN UPDATE

Executing a stored procedure with cursor in PHP

左心房为你撑大大i 提交于 2019-12-04 05:59:34
问题 I have a stored procedure that I am trying to call from my php. Here is the stored procedure: BEGIN DECLARE done INT DEFAULT FALSE; declare phone_temp VARCHAR(20) default ''; declare phone_cur cursor for SELECT DISTINCT sentNum FROM Queue; declare continue handler for not found set done = true; #create temp table create temporary table if not exists temp_return AS SELECT * FROM Queue LIMIT 0; #empty if exists delete from temp_return; open phone_cur; phone_loop: LOOP fetch phone_cur into phone

Changing the default cursor to busy cursor does not work as expected

房东的猫 提交于 2019-12-04 04:58:16
问题 After many attempts trying to make a JProgressBar work as expected, I finally became successful at achieving my goal. I had used @MadProgrammer's advice and used a SwingWorker to finally get the program work as I want. Now, I want the cursor to change into when my JProgressBar goes from 0% to 100%. I've googled and found out that setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); is the code to do it. I've tried it but it does not work as expected. Relevant piece of code: JProgressBar

How to flip to previous page with ndb cursors?

…衆ロ難τιáo~ 提交于 2019-12-04 04:55:55
I cant manage to get to 'previous page' in ndb paging. I have checked the documentation and also this similar question here without success. def show_feedback(kind, bookmark=None): """Renders returned feedback.""" cursor = None more_p= None if bookmark: cursor = Cursor(urlsafe=bookmark) q = Feedback.query() q_forward = q.filter(Feedback.kind==Feedback.KINDS[kind]).order(-Feedback.pub_date) q_reverse = q.filter(Feedback.kind==Feedback.KINDS[kind]).order(Feedback.pub_date) feedbacks, next_cursor, more = q_forward.fetch_page(app.config['FEEDBACK_PER_PAGE'], start_cursor=cursor) if cursor: rev

Emacs: prevent cursor movement when scrolling off of the screen

我与影子孤独终老i 提交于 2019-12-04 04:53:34
问题 I am reviewing some code in emacs that has a series of for loops that span several pages. The indentations done by the author are poor so it is not easy to tell where loops begin and end. I am using the highlight parenthesis mode to find where loops. However, it is often the case that the loop covers a few pages of code. Thus whenever I scroll to see more code the colors of the parenthesis change and I can't find where the loop ends. I've read other's posts about using mark and multi-window