19 Topics

Member Avatar for
Member Avatar for amishraa

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' )

Member Avatar for amishraa
0
177
Member Avatar for sivaindani
Member Avatar for joseph.lyons.754

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 …

Member Avatar for joseph.lyons.754
0
192
Member Avatar for -acir-

//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 …

Member Avatar for -acir-
0
220
Member Avatar for Arjun_Sarankulu

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 …

Member Avatar for Arjun_Sarankulu
0
143
Member Avatar for vazzdoin

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 = …

Member Avatar for Manda.Ravi
0
1K
Member Avatar for best4050

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!

Member Avatar for Ezzaral
0
215
Member Avatar for mits28

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) + "'>" …

Member Avatar for mits28
0
463
Member Avatar for oldezwe

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 = …

Member Avatar for stultuske
0
226
Member Avatar for oldezwe

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 …

Member Avatar for Ezzaral
0
232
Member Avatar for pawan768

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"> …

Member Avatar for pawan768
0
434
Member Avatar for ShaggyDogg

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 …

Member Avatar for ShaggyDogg
0
211
Member Avatar for Dani

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 …

Member Avatar for Perez_Bottoms
0
14K
Member Avatar for samuelhenry

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 …

Member Avatar for peter_budo
0
359
Member Avatar for sugumarclick

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 …

Member Avatar for sugumarclick
0
188
Member Avatar for RickW

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> …

Member Avatar for RickW
0
164
Member Avatar for sugumarclick

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 …

Member Avatar for sugumarclick
0
682
Member Avatar for P00dle

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 …

Member Avatar for P00dle
0
886
Member Avatar for talha06

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..

0
108

The End.