I'm using JMX to build a custom tool for monitoring remote Coherence clusters at work. I'm able to connect just fine and query MBeans directly, and I've acquired nearly ... |
I need to query an IBM Domino data store that was populated using Lotus Notes from within a Java application. I am hoping that IBM followed the JDBC design pattern ... |
I have not done database programming in C++ and C# before, but did some in Java. Now I am asked to figure out the options to do it in C# or ... |
I'm glancing through parts of the official db4o tutorial, and I'm trying to make a modification to the code they give you for running native queries:
//the original
List<Pilot> pilots = ...
|
I'm building an application that is a kind of registry. Think about the dictionary: you lookup for a word and it return something if the word is found. ... |
What is essential difference between these methods?
query() of JdbcTemplate and createQuery() of EntityManager?
As I understand, both execute query?
|
I am querying a database for a web service using the Jersey JAX-RS. I can return a single row as XML or JSON, but I can't figure out how to return ... |
|
For use in a language-learning web application, do you know of data structures and underlying database schema/ layout that would allow efficient storage, processing and querying of sentences, verbs, nouns etc. ... |
I am using database in one server .I wanted to access that database from multiple location but issue is that when one access that data in the table no body can ... |
Let's say I have an app that should ideally be able to use a relational database, object database, XML files, or whatever to persist its data. In the spirit of coding ... |
I have written the simplest implementation of DBMS using Java's JDBC. In my app I gve users ability to perform CRUD operations on some simple mysql database. Everything done in console. ... |
Is there a library which can determine for a jdbc driver class the appropriate validation query to use?
For example
If the jdbc driver is com.mysql.jdbc.Driver or com.mysql.jdbc.jdbc2.optional.MysqlXADataSource the library will know ... |
I dont know whether it is possible or not,But here is my question:
I am getting 13 input fields,based on input
Ex:String firstname=request.getParameter("firstname"); ......
I have to prepare sql where clause like if ... |
I need to extract data from an incoming message that could be in any format. The extracted data to store is also dependent upon the format, i.e. format A could extract ... |
I have a view defined as:
function(doc)
{
if (doc.type="user")
{
emit([doc.uid, doc.groupid], null);
...
|
can i execute two different queries in a single method using jdbc code..
|
I've been doing XML transformation for a while in my Java application and I'm still not clear what the options are and what the best option is to read records from ... |
I am trying to fetch data from a table which have very huge data some.
i am using Java Webobject and EOmodel.
While i am trying to fetch with a indexed column i ... |
My DB2 database is using UTF-8 encoding. The source table has one colum with UTF-8 text like these lines below
Greek: ????? ?? ??? ???????? ?????? ????? ?? ???? ??????
Czech: Mohu jíst ... |
How can I determine that particular query will change the state of DB?
I use JDBC. Should I use parsing searching for key words like INSERT, DELETE or there are some other ... |
I'm trying to use nested queries with JdbcTemplate but found the issue, it seems to me that it's doesn't suppot nested queries.. Am i right? or what i need to change?
So, ... |
I'm writing tests with JUnit for some methods operating on a test database.
I need to reset the database to the original state after each @Test. I'm wondering what's the best way ... |
If an application is blocking until a query returns a response, doesn't it make sense to put each execute queries on a thread pool?
|
I am looking at Couch Db and I saw Ektorp that presents a JPA like interface for database. However I see that there are examples that how to make query at ... |
I have a page with ADF Query and Trinidad table. Searching with af:query works well and populates the table with data.
On initial page load (when I enter the page for ... |
Is there a way (JDBC, Resource Adapter, etc) to query VSAM data from Java? Do solutions require something be installed on the VSAM system?
If JDBC, what limitations exist ... |
I am totally new to JDBC programming and need some urgent help..could anyone provide me the java code to take a query as user's input and provide the appropriate result??Many thanks ... |
I am trying to query an online site that is connected to a SNP to GO DB. The site allows the user to enter a list of SNPs and it ... |
How do I use the sql query to retrieve data from the database. For example I want to get the data from a table named "a". "Select expirydate from a where ... |
|
I can't see why it would matter what kind of a node your talking about, your decides what kind of node it is based on whatever business logic you have for that kind of thing. As far as I got before I switched to a more DAO-ish thing was just use the entitymanager wherever I ... |
Hello all, I am working on a small database and would like the results of a query to be displayed in the gui I have created in their respective areas. But when I click the button I get this error: at org.apache.derby.client.am.ResultSet.getString(Unknown Source) at desktopapplication8.DesktopApplication8View.jButton1ActionPerformed(DesktopApplication8View.java:617) Here is the Query code I am using: |
Hi All, In the database of my web applicaton i have around 50 users i want to use jbbc request two retrieve all the 50 users The test plan looks like this ... |
34. jdbc query jmeter.512774.n5.nabble.comHi All, I am doing performance testing of a sql query, In the database of our web applicaton i have around 50 users i want to use jbbc request two retrieve all the 50 users records. ... |
Hey, I have a web application which mainly involves filling up forms. I want to test this application. However one of the parameters in the form has to be filled up by after making a database (sql)query based on which I get the info. What is the best way to go about this? Can I use the JDBC SQL request feature ... |
Prasanna, The JDBC Request records the same sampler times as all of the other samplers. So, you can use any of the listeners, e.g., Aggregate Report. Steve Eckhart Business Analyst/Project Manager WAUSAU Financial Systems 14010 FNB PKWY STE500 Omaha, NE 68154-5206 Enterprise Payment Solutions. CONFIDENTIALITY NOTICE: This electronic transmission (including files attached hereto) is intended only for the use ... |
Hi, I was trying out a small program where I add a new column in the existing table (jbp_users) which comes(gets created) with jboss portal server 2.6.4. and the database is in MS SQL Server2005. I have created a new property "age" and have changed appropriate files to add this new property. Files changed to add new property : Identity.properties profile.xhtml ... |
|
Hello! I should develop an application able to run on PDA devices.Such application should be able to access to a database driven web site. (The web site is very complex and has an its own business logic, so it is no possible to redesign it). It should be possible to view the content of the site (with a layout that fits ... |
Hi, Is there a way I can make SQL queries case-insensitive in the select statement itself ? I'm passing user entered values to a prepared statement. My select statement looks like : SELECT EMPNO,EMPNAME FROM EMPLOYEE WHERE EMPNAME LIKE ? I'm using preparedStatement.setString(1,inputValue). Instead of modifing the inputValue with String class(ie,changing its case to format it to Mallika or Kumar,ie first ... |
Hi, I have a query tool which gets results based on inputs provided by users. I have several different SQL JOIN statements involving 6-8 tables in each query. Some involve outer joins too. I would like to know what steps should be taken to make these queries efficient and quick. I have been using the concept of having the smallest table ... |
Hi, Can someone explain when indexes will be used and when they won't be used in queries ? I have the following cases: 1. Select statement uses outer joins. 2. Select statemet uses like %a% statement. SELECT E.EMPNAME FROM EMPLOYEE E,ADDRESS A WHERE E.EMPNAME LIKE %A% AND E.ADDRESSNO = A.ADDRESSNO(+) In the above sample select statement, which colums should have index ... |
|
Ive got this loop in a servlet that needs to do multiple queries on seperate tables in a db.(MySql) I have to do it in seperate queries because a join is impossible with the data I am trying to return. Anyways if you look at the loop you will see the 2 inner queries & their corresponding if statements. If I ... |
Hi, I want to retrieve rows from an Oracle table which has values like "sp_bowl" or "asp_007" etc. My query is like SELECT MYROW FROM MYTABLE WHERE MYCOLUMN LIKE ? I'm using PreparedStatements, and passing Strings using preparedStatement.setString(1,"%"+myString+"%"). When the use enters "sp_" as the string to be passed to the query, I'm getting all rows which have "sp" in them, ... |
|
thanks for your reply, could you elaborate it further please? Also the the databases in question can be from different vendors e.g. oracle, ms sql, sybase etc. Database d1 could be oracle and Database d2 could be sybase thus is there any way to establish that the driver associated with these individual databases support multiple databases in the single query Is ... |
Your boss is recommending something that goes against the purpose of using stored procedures. Remember that sp's are precompiled and optimized by Oracle. They are ready to be executed yielding very fast performance. If you pass the sp as a string in a callable statement, or even just a statement, Oracle has to compile and optimize the sp before it will ... |
hi friends i am migrating database from MS access-Oracle 8i through SQL loader.My problem is if initially i have say 10 columns in my table and after that i add 1 more column in that table,now i want to add the data for the new column only through SQL loader,i don't want to made any changes in the previous records.How to ... |
Hi, I am using JDBC to connect to an Access table. I have a simple table called: Student (StudID, FName, LName, Marks) I would like to find out the student with the highest marks: SELECT StudID, max(Marks) AS maxMarks FROM Student GROUP by StudId I get multiple rows returned whereas I need only the highest one. I am facing a similar ... |
Hai, I have a oracle 8i database consisting of 10000 records in a table, Now i have to check nearly more than the number of records wether the specified record is there in database or not.so what i do is every time i make the query and check in the database. Is there any method to reduce my program execution. Even ... |
Hi Roy, Thank you so much for your help I added executeQuery but regarding second point I'm not sure my query is correct I put text in ' ' Am I correct?(since still ID=0 and is not returning any thing...) Many thanks, Elahe -------------- stmt = con.createStatement(); PrepStmt =con.prepareStatement("select ID from statusdesc where text ='"+text+"'"); PrepStmt.executeQuery(); System.out.println("ID"+ID); |
My last post won't work at all! Sounds like you may have to rethink the way you store your date data. It can be awkward to compare the dates if you separate the year, months, and dates into number columns. You'll have to do some fancy innefficient conversions every time you need to query the database with a between dates in ... |
I am creating a search engine for my database. I have JCheckBoxes that enable/diable JTextFields and/or JComboBoxes. I need to build a query based on what the user has selected and what has been typed in the textFields. Right now, there are a huge amount of IF statements in my code. But I was wondering if anyone knows a better, more ... |
the jdo spec makes the comment: "ordering specification: the ordering specification includes a list of expressions with the ascending/descending indicator. the expression's type must be one of" and then it gives a list, at the top of which is: *primitive types except boolean; I read this to indicate that I cannot order by a boolean flag. Fine, whatever. But I can't ... |
Hello, I have a question concerning the performance of a database query. The problem is as follows : I have a jList with items... When the user selects one, a query is made on the database to do a selection of fields which are then displayed in a jTable (I use an AbstractTableModel to obtain this). Everything works fine except when ... |
|
|
|
Elahe, if you want to make a calculation on grouped columns, then you should use subqueries. eg. SELECT (tPoints.coef2 - (select Min(coef2) from tPoints )) / (( select Max(coef2) from tpoints) - (select Min(coef2) from tPoints )/5)) FROM tPoints group by tPoints; The above query should give you (column_value - minimum coef2 in the tPoints table) / (maximum coef2 in the ... |
Hi, I'm trying to implement a query execute time-out in a Servlet using JDBC. The Servlet class throws an Thread for each query request, and waits for it's finish in a regular time. If ocurs a time-out, the main Thread interrupts the query Thread and returns an error to the client. The problem is, what should i make with the Connection ... |
|
hello, i'm a student and i'm have problems with a work i must do to school...I'm doing a database query to a SQL database (Northwind) and making a query of select *from (table)....and i'm trying to do a print and print preview of the result...but have many problems... The code the query is: public class Reporting extends JFrame { private Connection ... |
I am using a mysql database for a bookshop project i am working on. I am trying to run a select query to retrieve a list of book ISBNs, titles and authors that meet certain criteria. My problem is this: I have set my database up so that there is a many to many relationship between authors and books, so I ... |
Hi all, Is there any Query parser which will look at the Query and tell me that the Query is right. I m writing a Gui appln to allow user to write a qry thru a gui.After the qry is formed i need to chk if the qry is properly generated. Thanks in adv, Chinmay.. |
I need to get some information from a table and use it to populate a vector. I have examples of how to query the table but I don't have any examples on what to do with the info once I get it. Like once I get a stockname from the table how do I refer to that in the program. Am ... |
|
Hi Ariane, According to the code you have posted, it looks (to me) like you are trying to simultaneously open two different "ResultSet" objects using the one "Statement" object. As far as I know, this cannot be done. If I remember correctly, when you execute the second query, the first "ResultSet" is implicitly closed. (Hence the error message you claim to ... |
|
Hi, Just wanted to have some opinion on the fact that what will be the best way to design a query that is joining around five tables with around 80,000 rows and returns a resultset of around 170 thousand rows. I have ruled out outer joins as they are too slow. The problem is that when i run the query on ... |
The hardest thing for me when developing any kind of database app in java is when it comes to building dynamic queries within the application. For example, let's say you have 5 fields in a table and you can search for criteria based on 1-5 fields. So in the GUI you have 5 TextFields to be field in or left blank. ... |
Hi Only way to do the query optimisation is to populate the database with representative data (i.e a large number of records which are similar to those that you expect to see in production) and then examine the execution plan that is generated by the database server when you execute the SQL statement. Using the execution plan identify any horrors such ... |
This is probably more of an SQL question than a JDBC question, but I'll ask it anyway. I am updating an application I wrote where I assign trouble tickets to techs. I am updating it to assign multiple techs to 1 ticket and then any 1 of those techs will eventually accept the ticket. My problem is I can't figure out ... |
Hi, Excuse me if this sounds dumb, still learning this stuff... I have happily been working on a web app connected to a mysql databse on my pc using Tomcat for a while. Now I've come to put it on a web server, I seem to be having connection problems to the database. As I see it, this could be down ... |
Hi, I am trying to insert a value from table1 to table2. table1: name address city Ahamed XYZ Germany table2: name address city Rose XXYYZZ ? Which SQL statement i have to use for inserting table1 value 'Germany' into table2 column city ?? looking for solution... I am using MSAccess 2000 and jdk1.4. Help would be appriciated. Thanks, Ahamed. |
Hi, Is it posible to insert single colume value from one DSN table to another DSN table. table: DSN1 Name Adrress City aaa bbbb xxx ccc sss yyy table: DSN2 Phone Job City eee ttt qqq kkk Finally the DSN2 table look like table: DSN2 Phone Job City eee ttt xxx qqq kkk yyy Any sql quely like inserting DSN1table City ... |
Hi, Is it posible to insert single colume value from one DSN table to another DSN table. table: DSN1 Name Adrress City aaa bbbb xxx ccc sss yyy table: DSN2 Phone Job City eee ttt qqq kkk Finally the DSN2 table look like table: DSN2 Phone Job City eee ttt xxx qqq kkk yyy Any sql quely like inserting DSN1table City ... |
Hi I am confused about one thing. In the web context if i have a very large amount of data and i want to show it in html, it will take a very long time to retrive the data and than to show it. is there going the be a connection time out problem? Lets say if i have more than ... |
hai all, I wrote a app where i will give complex sql queries which may contain several joins. my program works with simple sql queries but throws exception when i give this complex quries. then how to solve this prob. I use createStatement() method. one more thing is when & how to use callablestatements? bye siva. |
hai all, I am writing an application where I am using JDBC to connect to access database. I am using the DSN to connect to the Database. I use the method createStatement() to create a statement object thro which I get a resultset by passing a query to the executeQuery() method. Whenever I give a simple query everything works fine but ... |
I would like to create a query that will read the username and passwords and also the user groups of around 200 people; in a static method, so that I will not be required to make a connection to the database for each coming login/password check. But still stays a problem, during the time the database might change, maybe a user ... |
Hello i have a doubt in writing ineer query .This is my query where all the fileds are in the same table named category and this works fine if i manually give the values in () where select PCategory_Id from catgory is written.can any one help me out fast in resolving this??? SELECT Category_Id,Category_Name FROM category where Category_Id not in (Select ... |
David, A stored procedure is useful if it can eliminate network traffic. For example, if I want to collect values from different tables and insert them into a new table, a stored procedure is useful. If I have a simple query that can be execute in one shot, like select name from table, a stored procedure does not provide additional benefits. ... |
Hi, In my application I have a search page in which the user can enter various search criteria. For example on one of the search pages there are 5 input fields. 2 of them are date fields one is numeric and the 2 are text fields. The user can enter search values in any of the fields. assuming the entered value ... |
I am currently in a situation where i have to write a query, the WHERE clause of which is a bit unusual. In the WHERE clause it is not the values to be compared that are variable, it's the columns themselves that are variable. The situation is such: As I am retreiving the rows, part of the where clause depend on ... |
|
|
|
We will be constructing a VLDB that allows end users to build and execute dynamic queries. We plan to queue expensive queries using JMS, and execute cheap queries immediately. Can you suggest a means to estimate the cost of running a SQL query in Java? This will be against an Oracle 10g database. I am familiar with explain plan, but I ... |
|
|
I have been breaking my head since one week to come up with a novel solution for the following problem: Lets take a typical database schema. It contains number of tables, of which , ... some have primary key/foreign key relation ship, ... there can be one or more tables which mediate to form a relation between two tables. User has ... |
Originally posted by Allen Tomas: Thank you for replying. However, I was actually looking helping in accessing a pre-defined query in access using jdbc connection. For example, in Access you could create a query and save as (for argument sake) myquery. Then in my java code, I want to access that query "myquery" and process it. It is sort of like ... |
In my jsp, I'm trying to pull data from a MS SqlServer 2000 db.I have a panelists table and a survey table. Panelists primary=record_id, which relates to panelist_id in the survey table. I want to pull data for panelists who have yet to complete a survey(i.e. panelists.record_id != surveys.panelist_id). I'm getting a null pointer exception. When I do a query for ... |
I get 1000 row with with select * from table1 but less row with select * from table1 where scheduling =2; 400 row and select * from table1 where scheduling !=2; 200 row. I checked the DB, there is data (400 row ) schduling as null. how can get the result for scheduling as null? Thanks a lot |
There's a syntax error in your second example, so that one's wrong. To answer your real question, I would always use single quotes when writing SQL queries as not all RDBMS support double quotes. I'm not sure what the ANSI standard says about it. From a JDBC perspective I'm not sure if it matters as I believe the query string will ... |
I configured the Tomcat 5.0.27 for using the connection pool feature and connecting to the Oracle. I am testing if I did the configuration correctly. Therefore, I try to retrieve some data from a table. I got the 'Null Pointer Exception" when executing the stmt = conn.prepareStatement( query ); I am not sure where the problem is from. 1. configuration is ... |
Hi e'body, Well, I am in a project where you query {DB2} database tables, having more than a million records; So what do you guys think is a better way to handle such a situation?? I anyway use DataSource Connection Pooling; any tips on optimized ways of querying is greatly appreciated..!! looking forward to hear from you guys.. i know, you ... |
99. Query coderanch.comWhats wrong with my String command.I cant figure out my quotes>i keep getting a syntax error public int amendProduct(int id, String name, double price) throws DaoException { Connection con = null; Statement stmt = null; int rows = 0; try { con = getConnection(); stmt = con.createStatement(); String command = "UPDATE Product SET item = " + id + " WHERE ... |
I am trying to execute this query (MySQL DB) and it is failing with Table is full error (I know I can make temp tables big). update t1, t2 set t1.XXX=1 where t1.YYY=t2.ZZZZ and t2.AAAA like '%X%'; My t1 has 10,00,000+ records and t2 has about 70,000 recorsds. I would like to know how can I optimize this query? What are ... |