result 1 « result « Java Database Q&A





__________________________________ put this code with result set:- for(int i=0;i

1. how to handle result set data    stackoverflow.com

I am getting lot of records in my Result Set. My concerns are :

  1. How Result Set handle these records internally? and
  2. How a programmer can handle those records in batches So ...

2. How can I use one stream and save result to many places?    stackoverflow.com

I using servlet and Apache ServletFileUpload that provides stream to uploaded image. All I want to do is to store that image to db and also store resized (I using JAI) ...

3. converting result set to list    stackoverflow.com

how can i conver result set to list? i am using following code but its not working properly

private List<User> convertToList(ResultSet rs) {
        List<User> userList ...

4. Best way to get a Web Service to return a database result as XML?    stackoverflow.com

I am building a webservice using jax-rs and querying a DB2 z/OS database with SQLJ and getting the result set as an arraylist. I would like to return this list as ...

5. Beginner JDBC Result Set questions    stackoverflow.com

New to using JDBC and I was wondering if all operations produce a result set. For example I am making statements to insert/update to a database via:

StringBuffer query1 = new StringBuffer("UPDATE ...

6. How to log junit test run results to a database    stackoverflow.com

We use junit for integration tests. The tests are being run in Eclipse and Jenkins. Now i would like to log all junit test run results to a database for easy reporting ...

7. Displaying result set dynamically    stackoverflow.com

   String query="select dept_id,deptName from dept";
    PreparedStatement ps=cnn.prepareStatement(query);
    rs=ps.executeQuery();    
    while(rs.next()){       ...

8. How to return a result set from a database in a webservice for J2ME Client consumption    stackoverflow.com

I am trying to consume a web service that returns a List of Entities from a database query (Using JPA). I created the J2ME stub but when I use it, it ...

9. JDBC Return results via writer to client program?    stackoverflow.com

I'm trying to return a mySQL result to my client program. I think its not connecting as I can return the connection error, but I believe all the settings to be ...





10. Display result from db onto webpage    bytes.com

How to display the result set in a webpage: 1. retrieve data from the database 2. i take it, i create a loop that creates tables with data in it for ...

11. java applet and accesing results from a database    forums.netbeans.org

i have written a code that is in java and it take files as an input through an applet and count the characters in each file and store the results in ...

12. How to report both success and failure test results to DB    jmeter.512774.n5.nabble.com

Hi, I'm using JMeter version 2.3.20090915. I've recently inherited an existing jmx file that has multiple tests, which all report to DB (using "Database Statistical Report" listener), and all these tests report to DB just fine (both success and failure result). My task now is to add a new test to this existing jmx file. This ...

13. JDBC Sampler - access to result data    jmeter.512774.n5.nabble.com

14. JMetere JDBC Test Confusing Result    jmeter.512774.n5.nabble.com

Hi, I am running JMeter JDBC test. I am getting confusing results which vary with no. of threads and no. of connection in pool Query: select sysdate from dual Test Case 1: no. of threads: 10 no. of connetcions: 1 Avg Sample Time is 5 ms Now i increase no. of connections to 2, thinking that it would decrease sample times. ...

15. Load results into database    jmeter.512774.n5.nabble.com

Hi Tony, There is a option to save your output files as CSV format as well. From there you can import it to any database. But a small trade off is that if you save the results as CSV, you can not view the output through Jmeter listener (Like Summary, aggregate, graph etc) So you need to calculate the those values ...

16. results database    jmeter.512774.n5.nabble.com

I started looking into it 2 weeks back, but I haven't gotten too far. I started by looking at some code contributed back in 2004, but I liked mike's ideas for a databasewriter better. right now I'm back on the reporting tool for jmeter, so I probably won't get back to it for a few weeks. if you want to try ...





17. Running Regular Expression extractor on the results of JDBC Requests    jmeter.512774.n5.nabble.com

Hello All, I am running the jdbc request sampler to execute a query "select userName, password from User limit 10" against a mysql database. The result that comes back is: userName password user1 password1 user2 password2 user3 password3 user4 ...

18. Store results in a database?    jmeter.512774.n5.nabble.com

G'day If you can get the data you want out of your sampler and into the JMeter environment (with one of the post processors, such as the regular expression extractor) then you can probably get the results into a database with a second sampler. Extract the data as above, formulate an update database transaction out of it, and use the ...

19. Result Set Sorting    coderanch.com

20. Result Set    coderanch.com

Oracle has some internal problems with prepared statements. On many occasions, even though you close the resultset and prepared statements, the cursors remain open. Soon you will get "Ora-1000 max number of cursors exceeded" or something to that effect. There are 3 workarounds: 1. set max number of open cursors in Oracle to a high number (at least 200... the default ...

21. returning a result set    coderanch.com

22. problem with result set,if multiple users access the application    coderanch.com

Hi all! thanks for ur concern in solving out my query. as u asked for the code, i don't know how best i can represent it to u, as it's very easy easy to get confused with the project specific intricacies & database details. few points i would like to mention.... 1. i don't know, what do u mean by "thread ...

23. search result display,very urgent    coderanch.com

In a portal(website) iam making a search.The search result has 10 records.i want to store these 10 records in any temporary memory space to see these results in the future. My aim is to provide a hyperlink 'My search results' in a page so that i can know the result of my search(10 records which i obtained from my search)whever i ...

24. Result Sets and odd reactions    coderanch.com

Here's the deal. I do the following code on my NT box against an DB2 database and this fails. If I push this up to the os/390 environment, it works. I tracked it down to be this. If I retrieve the same piece of information from the record set twice, it fails on NT.. but works on the os/390. I have ...

25. when to use commit (for result set?)    coderanch.com

26. Results Help    coderanch.com

27. Result Set problems    coderanch.com

Jennifer I dont know if this is it or not but could it have anything to do with the type of resultset your getting back from the query? I mean are you creating a default resultset which would be non-scrollable? I dont know how the internal cursor is maintained by theResultSet so maybe once you've started traversing it the cursor goes ...

28. Result set type    coderanch.com

Originally posted by Nischal Topno: If a result set is TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE, and if the query selects a DISTINCT, why does the resultset.next() return true even after there are not records. It gives "Invalid cursor state" error. Say, I have a table MYTABLE with a field MYFIELD with the following data in MYFIELD: ======== NOKIA ERRICSON NOKIA ======== The following ...

29. Result set getting closed    coderanch.com

Hai I executed a query to get a ResultSet1 using some connection and statement settings. Using same settings when i executed some other query first result set in automatically closed. This seems to be default behaviour. My requirement is like follows. --Execute some stored procedures. -- Then process each result set using same connection and statement. Problem here is once i ...

30. obtaining one result set at a time from multiple select    coderanch.com

Calling a stored procedure which returns multiple result sets. My problem which I cant seem to figure out; when I call cs.getResultSet() all result sets are returned ie 4. Im using ThinWeb Technologies(tm) Driver Version 1.3 for MS SQL Server. Why is this happening??? CallableStatement cs = myCon.prepareCall("{call initial_info (?)}"); cs.setInt(1, InfoGetter.locationInt); boolean success = cs.execute(); int i = 0; while(success) ...

31. Concurrent result set ?    coderanch.com

Hello ranchers ! I'm doing a simple Swing-based GUI application that can view, modify, add, delete records that are stored in a DB table. This application could be used by multiple users, and i have a problem with this: How do i actually have the records updates or additions or deletions by one client be known by other clients that also ...

32. Scrollabel Result set    coderanch.com

33. merging result sets    coderanch.com

Hello Friends i have a problem: I have to retrieve data from two tables each table contains two fields(for simplicity otherwise there are more) ie date and name. I have to merge the data from two result set and display the data sorted in order of date. Like this Date Name from Table1Name from Table2 1 Jan 2002 George Joseph 2 ...

34. nested result sets    coderanch.com

35. results    coderanch.com

36. Problems with Result Set's next method    coderanch.com

Hi All, I am facing this problem. When i try to print the one element of result set using the "while" loop,its not getting executed. ******************************************** connection = getConnection(); if(connection != null) { cstmt = connection.prepareCall("{call"+queryName+"(?,?) }"); System.out.println("Statement is "+cstmt); cstmt.registerOutParameter(1,Types.INTEGER); cstmt.registerOutParameter(2,Types.VARCHAR); cstmt.execute(); rs = cstmt.getResultSet(); System.out.println("Result set object is "+rs); } while(rs.next())//While loop not executed. { String id_trans = rs.getString("cd_interface"); ...

37. Problem with comparing results in jdbc?    coderanch.com

38. The result set behaviour    coderanch.com

Hi Amit, As Kirtikumar says, "what do you mean by sequentially?" If you mean that you want the result set of your query to be sorted, then as far as I know, no database (including MS Access) returns a sorted result set from a database query -- unless the query includes an ORDER BY clause. In other words, in order to ...

39. Delayed result with 'not like' clause in Where clause    coderanch.com

Hello all, I am new to database.I have a problem with my sql query. It takes 20 secs to execute (this return 127 rows). My query has a 'not like "%xyz%" ' clause in its where clause. When i change this 'not like' clause to 'like' clause, it returns me 137, but does this just in 1 second. The table has ...

40. making XML Doc from JDBC Results    coderanch.com

First of all it sounds like you're heading towards an XML solution without a clear need for it. Make sure you need it before you use it! There are probably multiple ways to do it, but for ease of use I like castor. It is object-centric, but provides both object to database and object to xml mappings. Therefore you need to ...

41. Result Set size problem?    coderanch.com

Hello, I have a problem to get the exact size of result set. Let us assume that my query get 20 results and another query get 30 results, now how can i adjust the size of my collection (array) dynamically to adjust w.r.t result set size. I use some technique that first get the count then perform another query for results ...

42. Result Set .Code check please    coderanch.com

43. Pagewise Results    coderanch.com

I am using below mention code to solve that kind of problem in my project and it's working properly TRY TO UNDERSTAND THIS CODE __________________________________ First declare one integer:- int start=0; __________________________________ when you print the user values just increment the value of this int:- out.println("

"+(start+(noOfComp++))+""+job+"

44. handling a larg size result set    coderanch.com

I would try making your SQL statement more exact. Try to let you database do all the work and just return the record you want. Instead of looping through the result set. If thats what you doing. If you can post your code i might be able to be more help full Best Regards, Brian

45. Partial Result Sets    coderanch.com

I was wondering if its possible to only retrieve a partial result set from a query. If I have a large result but only wish to look at the first 25 OR if I was wishing to check out 26 to 50. Can this be done? I'm using db2 with WebSphere 4.0.

46. Database output results to Excel    coderanch.com

Originally posted by Angela Koda: I checked all topics but could not find how to output database results to Excel. My SQL/stored procedures get database results from Oracle Database and I need to output data to Excel spreadsheet with cutomized formatting in spreadsheet. I am interested in mainly creating a Java application and not servlet/JSPs. Any help on this ? are ...

47. Result set / Arraylist    coderanch.com

I'm not sure why the 'list of maps' solution is popular at the moment (I've seen multiple threads refer to it recently), but it's not a solution I'm fond of. Personally: get a decent object-to-relation mapping tooll and forget that you have a database in the back end. Castor and Hibernate are popular. I'm not a fan of the array-of-maps solution ...

48. Search and Result Page    coderanch.com

I have a search page that is dynamically populated from the database. It has 4 pull down menus: Artist: Genre: Parental Advisory: Location: I need to construct a SQL statement from the selections and display the results on a results.jsp page. Do you know of any good resources etc. on how to do this? Thanks

49. Java Result Set    coderanch.com

Do "results" and "rs" refer to the same ResultSet object? If so, then I'd say that's your problem. ResultSet.next() not only tells you if there is another record, but also physically moves the "cursor" to the next row. So, if the the ResultSet contained only one row, then when your code reaches your while loop, rs.next() would return false. If that ...

50. how to get SYS.XMLTYPE with result set    coderanch.com

51. result set closed    coderanch.com

Hi i am using a DB2 driver for connecting to a java application and its able to open the database connection.but its giving the following record when trying to fetch the records.. the driver i am using is com.ibm.db2.jcc.DB2Driver com.ibm.db2.jcc.c.SQLException: Invalid operation: result set closed at com.ibm.db2.jcc.c.ca.T(ca.java:2682) at com.ibm.db2.jcc.c.ca.next(ca.java:221) at com.db.ac.mccTracking.business.query.ETListTableModelFactory.setETListTableModel(ETListTableModelFactory.java:442) at com.db.ac.mccTracking.business.model.ETListBean.updateListData(ETListBean.java:828) at jsp._0002fjsp_0002fETListCtrl_0002ejspETListCtrl_jsp_0._jspService(_0002fjsp_0002fETListCtrl_0002ejspETListCtrl_jsp_0.java:170) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130) ...

52. how to get top 5 result from database    coderanch.com

hi, good day, assume i have 500 records , and the records is actually the data of customer who have make transaction in a company, my question is how to i decide who are the top 5 customers who having deal with highest transaction volume in company.. anyone have idea ? thank you very much for your time !

53. apparent caching of result set    coderanch.com

54. processing result sets    coderanch.com

Hello there. Is it possible to process a JDBC ResultSet more than once. What I mean is that I want to pass a single result set argument to two different methods that both process the result set in its entirety. Code looks as follows: OracleResultSet ors1 = (OracleResultSet)stmt1.executeQuery(query1); checkCFCC(ors1); gfd.matchFeatureIDs(ors1); Both the methods parse the entire result set as follows: while ...

55. Check the result set    coderanch.com

Hi, I want to know what is the difference between while(rs.next()) and if(rs.next())? I'm not sure about this but I think that while is for more than 1 data in the db while if is to check whether there is data or not inside db and can only retrieve 1 data. so my question is: if I have no data on ...

56. how to display Result set pagewise    coderanch.com

57. Result set not showing the latest data    coderanch.com

Hello, I have a problem while retrieving the data from a table. The code gives correct result when run for the first time then if the table 'Demo' is changed using the SQL editor the subsequent retrievals give the old data and not the new one. Can anyone reply where i have got it wrong?. Thanks in advance. The code is ...

58. why get different result in different java version    coderanch.com

Jeanne, I know getMinutes () has been deprecated as we are supposed to use Calendar. and regarding precision changing This can be individual experience, but I have moticed it few days back and made this conclusion. now before posing this reply I have tested same again my environment details are JDK 1.5 Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production I have ...

59. getTables in DatabaseMetadata not giving proper results    coderanch.com

Hi, I'm using following code to get all tables types with name 'Addresses' by using getTables in DatabaseMetadata, but i m not getting proper results. ResultSet rs1 = dbm.getTables("MYDB",null,"Addresses", null); while(rs1.next()) { String sch = rs1.getString("TABLE_SCHEM"); String table = rs1.getString("TABLE_NAME"); System.out.println("Name =" + table); System.out.println("Schema =" + sch); } In MYDB database, I'm having three users 'dbo', 'alldata', 'user1'. My actual ...

60. executeUpdate() returning unexpected results    coderanch.com

M, If you want to know how many rows were deleted by the stored procedure, then you have to get the stored procedure to return that number. Calling the stored procedure via the "executeUpdate()" method will not get you that information. When invoking stored procedures you need to use the "execute()" method (and not "executeUpdate()" -- even though it successfully executes ...

61. Implementation of methods of Result Set    coderanch.com

There is where the Database Drivers comes into place. Now all database should support common operations of executing a query, trversion through the resultset, reading each column in a result, getting a connection,closing a connection ...etc. So these standard operations are made as interface methods by Java. Now the vendors who provide database drivers, implement this interface and hence they have ...

62. Conversing the result set data into XLS    coderanch.com

I would recommend to read javadocs provided by API, If you face any problem then many ranchers are here here is the code for your help I picked from same api's doc, coz I used this api once for reading only you can change for loop to your resultset's while loop DataFile write = DataFile.createWriter("8859_2", false); write.setDataFormat(new TabFormat()); try { write.open(new ...

63. Data result tree transform algorithm    coderanch.com

The result set like below L1 L2 L3 1 11 111 1 11 112 1 12 121 1 12 123 ... 2 21 211 2 21 222 ........ Need to output as tree, output as tree, L1 L2 L3 1 11 111,112 12 121,123 2 21 221, 222 .......... I can think the basic idea for that to convert it as ...

64. where to store results?    coderanch.com

see the code DataOnTable.java i writeen my Question? and what i want ////////////////////////////////////////////////////////////////////////// import java.awt.*; import java.util.*; import javax.swing.*; import javax.swing.table.*; import java.sql.*; public class DataOnTable extends JFrame { String [] columns ={"Client_id","Name","Address","City","State","balance due"}; JTable jtable; int k = 0,j = 0, i = 0; Object data [][] = new Object[20][6]; // Let as see code (line no 13), in this ...

65. Any way to sort result set?    coderanch.com

My program needs to display different "views" of a database. Basically I need the user to be able to sort the result set for any column. Is there any slick way to do this? I was thinking of putting the entire result set into a two-dimensional array, and then trying to sort it, but that seems inefficient. Thanks!

67. assigning result of executeQuery() to a variable??    coderanch.com

Hi, Considert the following situation: I have a table 'table1'. now I first need to delete all data in 'table1' and then insert new data into it from another table, 'table2'. Now if there is no data at all in table1, the next step (ie deletion) should not occur. For this I have written the code like this: PreparedStatement checkpsmt = ...

68. displaying results in a form    coderanch.com

I have a jsp which displays items available in the database in groups of their category ordered by catageory name. Each category is to be in a table with heading of the category name in a bigger font. Items belonging to that category will follow in the table in a smaller font having other columns like itemId, an image thumbnail, description ...

69. To compare output of result set    coderanch.com

Hi Ya, as of my knowledge the problem is at that part of code because if i remove check using if condition then im able to go to the next page and if replace rd.forward with rds.include im able to see the output(out.println(rs.getString()) of this page also(obvious). One thing i would like to tell you is that im including this part ...

70. result set problems    coderanch.com

71. Can i filter Result set    coderanch.com

I have a table login it has three fields username,password and address(all varchars). I want select all data from the table(select * from login) and store it in a resultset, then i want to get the data from the resultset as i need.like select only the usernames, select all fields for the given username etc; Is there any way that i ...

72. Multiple Result Sets    coderanch.com

73. A question on Result Set Forward Only    coderanch.com

Hi All I have read an article that says , Specifying the constant TYPE_FORWARD_ONLY creates a nonscrollable result set, that is, one in which the cursor moves only forward. If you do not specify any constants for the type and updatability, you will automatically get the default, which is a ResultSet object that is TYPE_FORWARD_ONLY and CONCUR_READ_ONLY In my program i ...

74. Result set type is TYPE_FORWARD_ONLY    coderanch.com

75. Problem in displaying result set value    coderanch.com

Hi , I am reading an image from the database..I am trying to get value of a column from the database(here name is the column in the database )and display it..After String name= rset.getString(name); is executed the page is blank..but if I comment the line then the image and other details are displayed ..Could anyone tell me what the problem is..here ...

76. Result Set    coderanch.com

Greetings everyone, When i try to print the result, it only prints first row even though it has multiple rows.What am i doing wrong here. ResultSetHandler h = new ResultSetHandler() { public Object handle(ResultSet rs) throws SQLException { if (!rs.next()) { return null; } ResultSetMetaData meta = rs.getMetaData(); int cols = meta.getColumnCount(); Object[] result = new Object[cols]; for (int i = ...

77. result set exhausted    coderanch.com

78. How to "page" results from a database?    coderanch.com

I'm probably missing something here, but I can't see a solution that will work with un-ordered data. If the data is not ordered, then can you guarantee that rows will be returned in the same relative position over multiple queries? Or is the data ordered but not keyed? John [ November 13, 2007: Message edited by: John Simpson ]

79. JDBC result set question    coderanch.com

80. result sets    coderanch.com

I have a class called Client, where I am making a call to another class called DB. I am passing in a select statement to the DB class, the DB class takes care of the driver, login, connection, statement, result set, and closing work. But I don't want the DB class to have to loop through the result, i want the ...

81. result value    coderanch.com

82. Result Set Portability    coderanch.com

83. displaying results after retriving from db    coderanch.com

Hi, The same situation came for me while displaying the catalog in a Shopping Application. U can do the following 1. u can display the first 25 records and break the while loop. 2. If the user clicks the next button , call the same servlet. This time pass the number of records already displayed as a parameter to the servlet. ...

85. how to paging database results in different html pages    coderanch.com

juan If you dont use EJBs you could also add the data from the DB to a list of custome objects and store it in the session. then the links on the page will include params that will indicate the current index and weather it's "next" or "back" which according to you will either add or take the number_per_page (your variable ...

86. JDBC result set - best way to store results?    coderanch.com

Hi I was wondering what the common ways to store the results of a JDBC query were. I have recently migrated from Perl, and am used to storing the results in a hash. Is there a similar data structure that can easily handle the results of the query. I have tried HashMap, but cant figure out how to get a key ...

87. Multiple Result Sets    coderanch.com

I have an app that is returning 5 result sets. When I run this stored procedure outside of my java app, it seems to work okay. However when I execute query it is doing something strange. The first result set will always only return one row. However the others could have multiple rows. The first time I did a cs.executeQuery().... worked ...

88. Generating Page Wise Results (20 results each)    coderanch.com

I have a jsp page, where-in I simply retrieve rows from a table. Now i want to display the results page-wise (20 results each) something similar to google. What are the best practices for accomplishing such tasks. I am using MySQL 5.0 ( so database specific solutions are also welcome) My tables would not always have ID numbers in serial order ...

89. limit result through JDBC    coderanch.com

I need to go other around 100,000 rows (row has 7 columns from join between tables) in bulk of 500-1000, do my process (around 20 sec for bulk) and take additional bulk .... My question: from performance perspective should i leave the result set open or for each bulk create result set and set beginning (by absolute ) at the end ...

90. isLast method for result set is not working    coderanch.com

Hi Paul, I think you are right that it does not exist for sybase. Could you please suggest some logic because i need to come out of the loop once i reach the last row? I don't know how will i come to know if i have reached to the last row without using isLast method. Please help.

91. result set not retrieved    coderanch.com

this code is written so that it will issue a insert statement and insert the username & password to the mysql database but it didn't do that .i have checked everything is fine till the line 32 ,but after that some problem is occuring . package shoppee ; import java.sql.* ; import java.io.* ; import javax.servlet.* ; import javax.servlet.http.* ; import ...

92. Order search results by relevance.    coderanch.com

Hello everyone, I am trying to order my search results by their relevance... Basically, I have an advanced search form with multiple input fields. Then I query a db table against the matching criteria. (Using Full Text in MS SQL 2005 Express). In order to sort results by their relevance, I used ORDER BY CASE. Here is a sample query: SELECT ...

93. getting in result set greater than 255 characters    coderanch.com

Hi, I currently have code that gets a result set from a stored procedure. Though the stored proc is coded with the output as a varchar(11000) the value inside the java code is getting truncated to 255 characters. The java type being used is Types.LONGVARCHAR. I am using JDK1.5, so LongNVARCHAR is not supported. Any ideas on how I can get ...

94. rs.next() always return true even no result is querried    coderanch.com

howdy Ranchers! I have weird behaviors from resultset -> it always returns true! I have this basic SQL statement:SELECT * FROM

WHERE shipment_no = I use this to check if there is existing records on the table. If not Existing, then I should insert a new records else I only just to update the current shipment_no.. Long l = ...

95. exhausted result set    coderanch.com

hello i have a problem in my java program which connects to a database. With my next button it will go through all the records in my table one time but when it comes back around i get an exhausted result set. Here is a copy of my code. I would be grateful for any help on this. thanks. private void ...

96. TYPE_SCROLL_INSENSITIVE corrupts the result set data    coderanch.com

Hi, When i execute a query without any parameters in createStatement like, stmt = con.createStatement(); and execute the query, the resul gets printed out correctly.. but if I set it like, stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); and execute.. it prints out "???" when Resultset is iterated.. Can anyone help on this? Thanks in adavance

98. how to retireve partial results from database    coderanch.com

hi, I have come across one problem. I have huge set of records in database (more than 3 lacs). when i fire query on database it takes lot of time to retrieve those records. so my applications response time is very bad. now i want to know that is there any way that i can fire query through jdbc and retrieve ...

99. Result set    coderanch.com

public String CheckValidUser() { String query = "SELECT * from users"; String result=" "; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); String url = "jdbc:mysql://localhost/moh"; conn = DriverManager.getConnection(url, " ", " "); Statement st = conn.createStatement(); ResultSet rs = st.executeQuery(query); while (rs.next()) { String name = rs.getString("name"); String pass = rs.getString("pass"); if (loginname.equalsIgnoreCase(name) && password.equals(pass)) { result= "success"; } else { result ="fail"; } } ...

100. batchupdateException.getUpdateCounts() doesnot return correct result as per JDBC api    coderanch.com

we are using following thin driver db.driverClassName=oracle.jdbc.driver.OracleDriver (type 4) Now when i execute the following code, int[] update = prepStmt.executeBatch(); and then lets say i try to insert a null in non-null column , i end up in following catch up block catch (BatchUpdateException b) { wfdata_dbConnection.rollback(); System.err.println("----BatchUpdateException----"); System.err.println("SQLState: " + b.getSQLState()); System.err.println("Message: " + b.getMessage()); System.err.println("Vendor: " + b.getErrorCode()); System.err.print("Update ...