19 Topics
|
|
Is there a way to get a total counts from the resultset of two unions? This will be for DB2. select count(*) from ( select count(*) from xyz where abc='1' union all select count(*) from x1y1z1 where abc='1' ) |
|
How to pass an row from resultset to an array[some index]=$row; |
|
Hey guys, i found this tutorial online that involved searching your database for an existing value. I have changed the code around so it fits with my system but when i run it the input displays but once i press ok the input box closes and nothin else happens. Heres … |
|
//compute percentage for Parent1 DecimalFormat df = new DecimalFormat("#.##%"); rs = s.executeQuery("SELECT " + "(SELECT COUNT(*) FROM genetic.blood_type where diseases = '" + disease1 + "')" + "/COUNT(*) AS rowcount FROM genetic.blood_type where btype = '" + btype1 + "'"); rs.next(); int result = rs.getInt("rowcount"); rs.close(); out.println(disease1 + " is … |
|
For Security Concern, I am using mssql_execute(). I am not getting way to get the recordset return from procedure. Below is my sample code $query = mssql_init("USP_GET_ICIN_DATA",$mssql_link); mssql_bind($query, '@ICIN_NUMBERS',trim($icin_data), SQLVARCHAR, false); mssql_bind($query, '@FROMRECORDNUMBER', $start, SQLINT4, false); mssql_bind($query, '@LIMIT', $limit, SQLINT4, false); $result = mssql_execute($query); while ($row = mssql_fetch_assoc($result)) { $icin … |
|
i am facing a problem in running multiple queries in jsp page, as it is unable to store the values in the 2nd result set i use in my page. tha code is written below: [code] String strQuery = "select * from services "; ResultSet rs =null; ResultSet rs1 = … |
|
I am using getRow() method of ResultSet class like: int rowCount = result.getRow(); but when i run the application, it gives me the exception that says: *The 'getRow()' method is only allowed on scroll cursors.* Please, anyone, who knows why it happened, explain it with some possible solutions Thanks! |
|
I am using two ResultSet in a single statement..this code is a part of servlet.. [CODE] String temp=request.getParameter("cid"); int cid= Integer.parseInt(temp); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:Mydatasource"); PreparedStatement ps = con.prepareStatement("select * from Products where cid=?"); ps.setInt(1, cid); ResultSet rs = ps.executeQuery(); while(rs.next()) { out.println("<a href = 's_BikeServlet?pid="+ rs.getInt(1) + "'>" … |
|
Below is what I have been attempting to do. [code]retrive number of rows from MySql table; for(int i = 1; i <= numberOfRows; i++){ retrive userID, level at position(i) in table; // next i need to insert userID into array, level amount of times (ex. userID = 4, level = … |
|
I am attempting to take 2 integers from a MySql table. X represents a number that will be stored into an array. Y represents the number of times that X will be put into the array. I am attempting to make a loop that will go through, find all the … |
|
I use two ResultSet , One in the another one. [CODE] try { con1 = DriverManager.getConnection ("jdbc:odbc:java"); smt1=con.createStatement(); if(sele.equals("ALL")) { rs=smt.executeQuery("select * from Stations where State='"+st+"'"); } else { rs=smt.executeQuery("select * from Stations where City='"+sele+"'"); } while(rs.next()) { stid=rs.getString(1); ofid=rs.getString(2); name=rs.getString(3); num=rs.getString(4); des=rs.getString(5); dis=rs.getString(6); %> <tr style="border: blue dotted thick"> … |
|
Hi, I'm trying to present results on an aspx web page where a store procedure parameter is defined by a dropdown list control on the page. To help accomplish this, I have followed [URL="http://support.microsoft.com/kb/306574"]this guide from Microsoft[/URL] and have my resultset presented in a DataGrid view. But I cannot seem … |
|
I have a somewhat complicated select query which returns, in part, the following resultset (as an example): [code=text] threadid views -------- ----- 1 5 1 5 2 10 3 15 4 10 [/code] If I were to do the following select: [code]COUNT (DISTINCT threadid), SUM (DISTINCT views)[/code] then it would … |
|
i have a jsp page with some fields ...i.e textfields n below that i have some 4 buttons named first,next,prev,last when i click on the button named 'first' i should get the first record from the database n if i click on the button named 'next' i should get the … |
|
hi friends, I am a novice java programmer. I am in a learning process in java servlets. But i struck into a Class method which should return a result set([B]result of a join query[/B])as a an arrayList using the existing bean class. I will show my code as some one … |
|
I have this output from a mysql export: [code] <?xml version="1.0"?> <resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" statement="select product as sample,count(*) as count from table1 where itemno in (5,10,37) and type='food' and package='boxed' group by package,product order by count(*),product desc limit 5 "> <row> <sample>cereal</sample> <count>1</count> </row> <row> <sample>macaroni</sample> <count>1</count> </row> <row> <sample>cookies</sample> <count>2</count> … |
|
hi friends, I am a novice java programmer. I am in a learning process in java servlets. But i struck into a Class method which should return a result set as an array. I will show my code as some one can point out where am i going wrong. Currently … |
|
I have a client and a server - the client sends the server a message, and depending on what message is sent, the server will perform an action and then reply to the client. Most of the actions that I have implemented are working. I need help with one of … |
|
Hi everyone, I want to convert [B]JDBC ResultSet to JSON Array[/B]. As u guess, direct casting isn't allowed.. How can I convert my DB data which is stored in ResultSet to a JSON Array? I'll be happy if someone can help me. Thanx in advance, With regards, Talha.. |
The End.