Result « Operation « Java Database Q&A





1. Application to query a database and send results as file via HTTPS    stackoverflow.com

I've currently got a tool which allows me to configure a database connection (using JDBC) and specify a set of queries to run against the database. This is scheduled to run ...

2. Different results from .mdb vs .odb, why?    stackoverflow.com

I use the following query to retrieve data from a .mdb file through JDBC, however when I try it on an .odb file it goes does not throw any exceptions but ...

3. JDBC: Is it possible to execute another query on the results of a previous query?    stackoverflow.com

I want to first get some result set (that includes two joins and selection), and then get the maximum value for one of the columns in the result set. I need both ...

4. Approach for representing command-line interface commands in code: Implementation of "database" where a query and result is obtained from proprietary...    stackoverflow.com

Problem Domain:

I am working on a new revision of a Java application that connects via SSH to a proprietary, Linux-based platform's Command Line Interface (CLI). Everything on the platform that ...

5. Sorting SQL query results in Java    stackoverflow.com

Firstly my apologies for putting some large text here. Below is the result by executing SQL query in Java but I want it to short it out using timestamp. For eg. TimeStamp in ...

6. ibatis query gives many results but only one is needed    stackoverflow.com

I am optimizing database usage on ibatis SQL queries. I have a situation where the query results many entries but only one of them is needed. QueryForList gives too much extra ...

7. SQL queries through Java, "Illegal operation on empty result set"    stackoverflow.com

I'm making a db call as follows:

String sqlAlert = "SELECT * FROM demotable where demo_no ='"
                ...

8. Is there away to load result query to memory in Java?    stackoverflow.com

I have a huge database (2.1 billions row) and I need to perform some calculation to extract some statistical results. To my understanding, it's obvious that it is not wise to ...

9. converting Coldfusion query results to formatted javascript array    stackoverflow.com

I am trying to write ColdFusion code runs a query then puts the results in an array in a certain format. the query:

<cfquery name="get_cbox" datasource="ds" username="un" password="pw">
    SELECT CBOXADD, ...





10. Continuous streaming of database query result set using JDBC    stackoverflow.com

I'm building a viewer showing huge runtime data in to charts. I'm planning to have a database to maintain this data. So there will be 2 separate applications reading and writing ...

11. Default page size for database query results    forums.netbeans.org

Is there any way to change the page size of the query results when you perform an sql query on a database configured in netbeans? I know that you can enter a number into the box, but any new queries dont pick up the new number. Is there a setting somewhere that you can edit the global default page size? thanks, ...

12. How to query the database and save the results to a csv files    jmeter.512774.n5.nabble.com

Are you saying that you have a requirement to only use a csv file with JMeter? That seem unlikely. If not, then why don't you want to use a database? Try using the JDBC Request Sampler - it's really very simple. If you really, really only want to use a comma delimited text file, then sure, you could use beanshell processors ...

13. Unexpected results from query....    coderanch.com

Hi, I'm executing a query which is like: SELECT USERNAME,USERNO........FROM USER WHERE USERNAME LIKE ?; I'm using PreparedSatements for this, and passing the value entered by the user. If user wants to search for a name beginning with Ma_, I'm passing 'Ma_%' to the SELECT statement. But I get all rows beginning with Ma, including ones like Ma9189,Ma7594, then I get ...

14. Result of query in multiple lines    coderanch.com

15. Setting max results from query    coderanch.com

We use a Weblogic-specific class called QueryDataSet to perform searches in our webapp. A QueryDataSet is a convenient way to execute a select and retrive the results in a ResultSet-like form. The advantage that QueryDataSets had over straight Statements/ResultSets is that we can retrieve only the first n results, process them, and then fetch the next n results, proces them, etc. ...

16. save query result    coderanch.com

This should do what you want: Assume the resultset has 5 columns: PrintWriter out = null; try { out = new PrintWriter( new FileWriter( new File( c:\path\filename.csv ) ) ); } catch(IOException e) { JOptionPane.showMessageDialog(null, "Error creating output files: \n"+e.getMessage()+"\n\nEnsure that " + dataFileCreated + " is not currently in use by another program.", "Error Creating Data File",JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } ResultSet ...





17. Updating a result set    coderanch.com

OK. I found some code to make PreparedStatement updatable, however, it doesn't seem to be working. Could someone look at this code and see what I'm doing wrong? rsGen = genPS.executeQuery(); while(rsGen.next()) { if(rsGen.getDate(9).equals(dflt)) { rsGen.updateString(9,""); rsGen.updateRow(); System.out.println("Dates are equal" + dflt); } System.out.println(rsGen.getString(9)); } rsGen.beforeFirst(); general.getResultsModel().setResultSet(rsGen); This compiles and runs without error, but when I try putting my result set ...

18. displaying sql query results    coderanch.com

Hello, I am trying to print the results of a simple query. ITEM is the first of four columns in my table, and is the only one I want to see the results from. But the browser only displays the basic info from the jsp code near the top of the program when I enter the url. I have marked the ...

19. Query Results    coderanch.com

I have an application saving data to an access database. I have created queries whch are displayed on an HTML page. What I would want is to be able to click a button for reports which will automatically open the HTML page displaying the query results. How can I do this. Please help, if possible with the aid of a simple ...

20. ways to store results from query?    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 ...

21. Can't get right results from a query    coderanch.com

Hi all, i have developed a stand alone program that runs from the command line. this program connects to the mysql database but the results it returns are not right. i need your help on how best i can refactor the following code to provide the right results because this query should return all the firstnames in the database students. private ...

22. Making Updates to Updatable Result Sets    coderanch.com

Tim, I'm quite sure that row locking would depend on the database and JDBC driver you are using. I know that Oracle's locking behaviour is different to Informix's (for example). I believe you will find the answer to your question in the Oracle documentation, which is available from: http://tahiti.oracle.com I believe that the "Concepts Guide" will explain Oracle's locking mechanisms (and ...

23. How Result Set can be upadated while we insert the data programmatcally    coderanch.com

By the way why you need previous row to insert the next row. I can think of incrementing the primary key column value, right? it is not a good approach though. writing the JDBC code in servlet is another worst thing. you can have 2 VOs in parallel. [ February 17, 2005: Message edited by: Adeel Ansari ]

24. can you execute a query while processing results    coderanch.com

can you execute a query in the while loop of a different resultSet? e.g.,... line2= ("Select teamName, played, won, lost, draw, forfor, against, points from leaguetable where tourId = " + tourId); query4 = stmt.executeQuery(line2); while (query4.next()) { teamName = query4.getString(1); playedTemp = query4.getString(2); played = Integer.parseInt(playedTemp); wonTemp = query4.getString(3); won = Integer.parseInt(wonTemp); lostTemp = query4.getString(4); lost = Integer.parseInt(lostTemp); drawTemp = ...

25. Query giving me two different results    coderanch.com

adeel, You are just confused with output. This is perfectly correct in to_char with date whenever you write two D (DD) oracle consider it as you want date in output but when you write one D (a single D) Oracle consider it as you want the Day of week. Like if we execute this query today you will get value of ...

26. querying against Result Sets.    coderanch.com

Is it possible to run a query against a resultSet? As opposed to getting a resultSet, creating a new table, and then querying against that or creating a new query from two? I have to write code that will allow a user to create as series queries each one run against the previous queries results (so that the queries are against ...

28. Caching of Query Results    coderanch.com

Sorry If u find simillar topic in Performance Category. I by mistake posted in Performance category. I am having a question on caching of query results. I am having an application in which I am displaying the user, records from sybase database. When the first time I show the application form, correctdata is displayed . Now I go to the database ...

29. Capturing result of SUM query    coderanch.com

I'm stuck trying to capture the output of the SUM SQL command. I have a table called Coins with columns Type, and Value. The exercise asks us to (among other things) use the 'SUM' SQL command to get the sum of the Values column. Here is the section of code that is giving me trouble. //Use SimpleDataSource to get connection Connection ...

30. Updating rows in result set, should select for update be used?    coderanch.com

You can issue update dml after call to processTask method. Only thing you need to be careful is you should NOT read the status flag from resultset (rs) as the value will be dirty. The more cleaner way will be to select 20/n record at a time and copy into a DTO/VO collection, iterate the collection, process and update the status ...

31. JDBC updates using result sets    coderanch.com

Hi folks, I am trying to update a blob field in a MySQL database using updatable result sets. Should be simple. I have no problem updating my blob using prepared statements or updating other fields on the table. The problem is with the blob! I am going crazy trying to figure this out. Would some smart soul please take a look ...

32. insert command not give me error and not give result    coderanch.com

hi master sir i use this blow code for insertion and show recored this code show record in jsp page but not insert record and not any error <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> --%> <%@ page import="java.sql.*,java.util.*" %> <%@ page import="javax.sql.DataSource" %> <%@ page import="javax.naming.Context" %> <%@ page import="javax.naming.InitialContext"%> ...

33. How to update from result set using new INNER JOIN syntax instead of WHERE clause?    coderanch.com

There was an interesting discussion on the MSAccess newsgroup about the old way of doing SQL joins using the WHERE clause verses the new way using the INNER JOIN syntax. If you are using the view feature (common to many databases including MSAccess) apparently there is an incentive to abandon the old WHERE clause (when possible) in favor of the new ...

34. incorrect MAX result with query. (diagram photo included)    coderanch.com

All records in a query result set must be uniform in type. Therefore, your combination "SELECT MAX(note_date),..." will not work since it should return the max note date and all records joined with in. If you want a single record you need to indicate that such as "select record where note_date = (select max(note_date))".

35. Strange query results using Java, but OK w/SQLSVR Mgmt Studio    coderanch.com

Hi all, Long story short: When I perform the query: use conversion select met_code, met_last from r5meters from within SQL Server Mgmt Studio, the results are correct, and what I expect: Meter1 1.0000000000 Meter2 2.0000000000 Meter3 3.0000000000 Meter4 4.0000000000 Meter5 5.0000000000 Meter6 6.0000000000 Meter7 7.0000000000 DFS1 14.3327777778 DFS2 14.3327777778 DFS3 0.0000000000 DFS4 11.3544444444 DFS5 14.3327777778 DFS6 14.3327777778 DFS7 14.2019444444 DFS8 14.3327777778 ...

36. Best Way to Exclude Results Based on Unrelated Query    coderanch.com

Hi everyone, We have created an ad serving solution (can be see at www.mmoabc.com if you create a free account and click on "Rewards"). When a user completes an offer, the system should not show that offer to the user again. Unfortunately, I have to work in ColdFusion for this process. My problem is that I don't know how to do ...

37. SQL query not giving any result    coderanch.com

Hi, I'm trying to get some records by using this query in Java. SELECT * FROM NetNanny WHERE (status='ACTIVE' AND 1306866600 < nextBilling AND nextBilling < 1306953000); but this doesn't give any result. but when I executer the query in mysql, It gives some records. Waht could be the reason. This the table sreucture for myDB CREATE TABLE IF NOT EXISTS ...

38. Query to not duplicate join results (resolved)    coderanch.com

I am having a problem with writing a query to do what I want it to. I have three levels, or nodes, of data that I want to retrieve for users. A parent node MAY have siblings and CAN have multiple children who themselves can have siblings and can have multiple children (three levels). When the query runs, I'd like for ...

41. Can someone please explain to me the proper way to display the result of a SQL query    java-forums.org

I keep getting stuck on this. Here is my servlet: Java Code: package HWpackage; import java.io.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.*; import javax.servlet.http.*; public class DemoData extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { out.println(""); out.println(""); out.println("Demo of Data Persistence"); out.println(""); out.println(""); ...

42. Cannot display SQL Query results in textboxes of application    forums.oracle.com

//ARLinkConnection runnable = null; //ARLinkConnection stmt = runnable; quitLoading.setEnabled(false); clearData.setEnabled(true); runner = null; } catch (Exception e) { status.setText("Error: " + e.getMessage()); } } This is my problem code; let me explain. PO is my application. header is in the code as JTextField[] header = new JTextField[15]; headers is String for JLabel[15]; now ARLinkConnection is my connection class to our oracle ...

43. How to set the link to the result which are executed my query from database    forums.oracle.com

Hi, i have successfully displayed the results which are available in the database by jdbc, query. Then, How to give the link like href to each & every result... note: The number of records may be change. depending upon the records availablity in the database. but every result have the link. Thanks in advance. Regards Kumar

44. strut jdbc result set query    forums.oracle.com