How to get the row's size of ResultSet ?
i can't find a method to return the record number of a ResultSet.
how can i get it without using the next() method and select count(*) from sometable
If you use a scrollable ResultSet, you can do something like this:
int currRow = rset.getRow();
rset.last();
int numRows = rset.getRow();
if(currRow == 0)
rset.beforeFirst();
else
rset.absolute(currRow);
[/code}
Similar Messages
-
How to get the row Count of a ResultSet
How to get the row Count of a ResultSet
Hi
I'v tried rennie1's way ,but I only get zero,my code is:
rs.executeQuery("select count(*) from t_test");
if (rs.next()) int rowCount=rs.getInt(1);
I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
I tried another way,the code is:
while rs.next(){
// Do nothing ,just move the cursour to the last row
int rowCount=rs.getRow()
However,the rowCount still equal zero
Any help would be greatly apprecite!
note:
I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle. -
How to get the rows from a table having some column has any letter
Hi All,
suppose i have a table having columns id(number), code(varchar).
code has alphanumeric characters (ex. ABC123, 67B56 etc).
some codes are only numbers (2344, 7898 etc).
how can i get the rows which have alphabets in the code.
ex:
id code
1 AB45
2 456
3 890
4 67B7
how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
thanks in advance to allThanks to one and all.
i am gettig my required output.
But i have a doubt in the operator.
If i add or remove '[]' in the operator, i am getting different ouputs.
There is a count difference in the result of the operators used.
REGEXP_LIKE(<column>,'[[:lower:]]')
REGEXP_LIKE(<column>,'[[[:lower:]]]')
REGEXP_LIKE(<column>,'[:lower:]')
Can anybody please explain what is the difference in using '[]', in the operator?
What is the correct syntax, whether i have to use two '[]'s or one '[]'.
Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
Any query to get the required output in 8i version?
Thanks in advance to all. -
How to get the current Mailbox size
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?Originally Posted by NanLau
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?
Can anyone answer this? Thanks. -
How to get the rows gap in the application file...?
Hi All,
Im working with Application server and I have a query like after transferring / printing 100 rows in the App server, I need 2 to 3 rows gap and then remaining will print.
How to get the gap in the application file.
Pls let me know.
Puppy.Hi,
when you are transfering the data to file
loop at itab in wa_itab.
counter = count + 1.
transfer wa_itab to fiel.
if counter = 100
clear wa_itab.
transfer wa_itab to fiel.
transfer wa_itab to fiel.
transfer wa_itab to fiel.
clear counter.
endif.
endloop.
regards,
Munibbau.K -
How to get the actual screen size
Hi,
I have to get the actual screen size of the cliend in an applet, if i use method
Dimension dmx = Toolkit.getDefaultToolkit().getScreenSize();
it does not gives the actual screen size, like the screen size will be different if the application bar ( where we have start button on windows ) is Auto hide, and will be different it is not Auto Hide, or some users ike to keep the application bar on right or left of screen or on top..
So how do we get the actual display size of screenHi,
I got how to do if using applet
in screen object of java script we have methods to get the available width and availabe size
screen.availWidth
screen.availHeight
here is the link for more info
http://developer.netscape.com/docs/manuals/js/client/jsref/screen.htm
http://forum.java.sun.com/thread.jsp?thread=275329&forum=57&message=1063410 -
Hi list,
does any one know how I can get the row number the same as what I have in column rowno?
thanks
Arvin
REATE TABLE dbo.temptable
( y int NOT NULL,
e int not null,
c int not null,
rowno int not null)
/* insert values */
INSERT INTO dbo.temptable(y,e,c,rowno ) VALUES
(1,1,1,1),
(1,1,2,1),
(1,1,3,1),
(1,20,1,2),
(1,20,2,2),
(1,20,3,2),
(1,3,1,3),
(1,3,1,3),
(2,1,1,1),
(2,1,1,1),
(2,2,1,2),
(2,2,1,2);You may update your rownumber column with Column "e".
But why do you duplicate your data? May be there is no particular reason, you may be wasting space for it
Try the below:
CREATE TABLE dbo.temptable
( y int NOT NULL,
e int not null,
c int not null,
ronum int null)
INSERT INTO dbo.temptable(y,e,c ) VALUES
(1,1,1),
(1,1,2),
(1,1,3),
(1,20,1),
(1,20,2)
select * from temptable
update dbo.temptable Set ronum=e
Select * From dbo.temptable
DRop table dbo.temptable -
How to get the personal folder size
Hi,
I'm trying to develop a method for define the maximum size of personal documents folder. I'm changing the Upload Command, and I want to know if its possible to get the current size of the personal documents folder for the user that is trying to upload the document.
For this moment, I've got the current UserID, and I have created an RID with the path "userhome/UserID/Personal Documents", but now I don't know how to get the size of this folder!!!!
Thanks to all.
Arnau RoviraOriginally Posted by NanLau
Hi,
Does anyone know how to get the current size of Mailbox and Archive by using GW api?
Can anyone answer this? Thanks. -
How to get the row reference of inner table of an advance table
Hi Gurus,
Using R12.1.3, How to get the handle of inner table row reference of an advance table in controller.
Regards,
ZakirThe javadoc for oracle.jbo.Key is really helpful.
getAttributeNames()
getAttributeValues()
etc -
How to get the Row and Column values in ALV (without using Objects)
Hi All,
I need to get the Row / Column when double click is used in ALV, I can use the double click event for this. However, I do not want to use the Object Oriented ALV. I want to implement the same functionality using general (using functions) ALV.
Is there any way to get the row / column values for a Generia (non-OOPs) ALV report.
Please help.
Thanks,
Vishal.Hello,
The only think you have to do is to get the index where the user clicked, and then read the internal table you sent to the alv
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'prg_name'
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND' " this is to the click event!!
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = alv_layout
it_fieldcat = alv_fieldcat
i_save = 'A'
it_events = alv_events[]
TABLES
t_outtab = i_totmez. ---> TOUR IT.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
" then....
FORM user_commandUSING r_ucomm TYPE sy-ucomm
ls_selfield TYPE slis_selfield.
" r_ucomm -> HAS THE STATUS
" ls_selfield-tabindex -> HAS THE SELECTED INDEX
" THEN READ THE INTERNAL TABLE
" HERE YOU WILL HAVE THE SELECTED ROW
READ TABLE i_totmez INDEX ls_selfield-tabindex.
ENDFORM.
cheers,
Gabriel P. -
How to get the row count of a Table DATA?
Hi,
In my Adobe form layout, I have a Table node which is bound to an internal table. Now at runtime, I want to determine the number of rows that the internal table has, i.e the row count of the DATA node of the Table. How will I be able to determine the no. of rows of the internal table at runtime using Javascript? I am not being able to find any suitable answer in this forum. Please suggest. Thanks in advance.Hi,
If you bind the interactive form table to the internal table and specify some properties, the table will vary its row size according to the number of data available in the internal table.
You have to wrap the table in a sub form, check 'allow page break with contents' and property 'flowed'.
the table will automatically increase its row size...
Is this the reason for which you wanted for the row count..?
If so, this will help you..
Regards.
Surya -
How to get the row that has failed due unique constriant voilation
Does any body knows how I can get the column values for rows that has failed on unique contriant voilation, I am using 10gr2.
Also we don't have license for shadow table error logging, otherwise I could have gotten the row from there.
Any help will be highly appreciated.
Thanks,
RaviHi Ravi,
Prior to OWB 10.2.0.3 you can use the DML error logging features only for the mappings which runs
in ROW based mode.
But from OWB 10.2.0.3 onwards DML error logging features can be used for SET based mappings also.
You can refer the following Metalink notes for the same
1. Note 550036.1 DML Error Logging In OWB 10.2.0.3 And OWB 11g
2. Note 549845.1 How To Use Data Rules And Error Tables Features In OWB10gR2
Thanks,
Sutirtha -
How to get the rows in a multiselect table automatically checked?
Hi,
I have retrieved all the rows whose job status is 'Manager'. Now i need these rows to be automatically checked when a button is clicked.
how do i do this?
Please reply as soon as possible.Hi,
is this a new thread or is it a duplicate of http://forums.oracle.com/forums/thread.jspa?messageID=2339633
Frank -
How to get the row selected in af:inputComboBoxListOfValues
Hi,
Am using jdev 11.1.1.2.1.
Am using af:inputComboBoxListOfValues component , i have made the component based on the " department id" and the display value is " department name".
In the value change listener i want to get the selected department id but currently am getting only the department name.(using valueChangeEvent.getNewValue().toString())
So is there any way to get the entire row and get the "department id" using that ??
Please help.
Thanks,
HariSorry for the confusion, needed to check it out:
this code should work:
public void nameValueCangeListener(ValueChangeEvent valueChangeEvent) {
FacesContext contxt = FacesContext.getCurrentInstance();
valueChangeEvent.getComponent().processUpdates(contxt); // after this the new row is selected!
BindingContext lBindingContext = BindingContext.getCurrent();
BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("YOUR_LIST_BINDING_NAME");
Row lFromList = (Row)list.getCurrentRow();
Object lAttribute = lFromList.getAttribute("YOUR_ATTRIBUTE_YUO_WANT_TO_GET");
}Timo -
How to get the HTML page size displayed in JEditorPane
Hi All,
I'm using a JEditorPane object in order to view/display an HTML page. The nature fo my program is that it does not know the size of the page in advance, but only on runtime. I'd like to get the size of the HTML page in order to determine the frame size according to the size of the HTML page.
Is there a way to get the size of the HTML page from the JEditorPane?
Thanks.after displaying the page in your editor pane you can get the diamension for the page by calling
JComponent class method getSize();
actually your question is not so clear
use the JScroll pane then you don't need to worry about the size of the page.
Maybe you are looking for
-
Hi! My name is Eirik Solberg and i have been waiting for the iPhone 5 unlocked version at apple store us seens the iPhone 5 came out at 12 september. Therefor i will be very happy if you guys could tell me when iPhone 5 unlocked version will come out
-
Email-statusing -service error
Hi All, After configuring Email-statusing-service properties in config.properties file and running run.sh file throws the below error .Please sahre your ideas on this ... 12 more 2012-11-20 18:15:00,013 [org.springframework.scheduling.quartz.Schedule
-
How do you get the display to normal view. Cannot see top menu
Display seems magnified. How to get it to normal view to be able to see top menus
-
Hi Friends, Here is my query on BIW. User getting the error as "Compile error in Hidden Module:cBEXconfac" while executing the query. Plz help me on this if someone face the same prob. Thanks a lot in advance. mrutyun^
-
How can I store photos already taken in iCloud?
Can you only store photos taken after you set a photo stream? Or can I store all of my pictures?