"SQLException: No ResultSet was produced".
i keep getting this error, any ideas anyone!
thanx
Quite possibly using a resultset object with no resultset in it. You do check before using it, right?
Similar Messages
-
Java.sql.SQLException: No ResultSet was produced
HCAF_PLCaddEngName = EngiNameTextField.getText();
Connection connection = null;
Statement statement = null;
try
// Load the JDBC driver
// Create a statement
statement = connection.createStatement();
// Execute a statement
resultSet = statement.executeQuery("INSERT INTO Table_name (Emp_name) VALUES ('"+ HCAF_PLCaddEngName+"' )");
Move = resultSet.next();why is it that i keep getting this erros:
java.sql.SQLException: No ResultSet was produced
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:259)
at RevisionIn$addButton.actionPerformed(RevisionIn.java:176)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:5517)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5282)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3984)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1791)
at java.awt.Component.dispatchEvent(Component.java:3819)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Java Result: 1
BUILD SUCCESSFUL (total time: 8 seconds)what cmd should i used in this caseYou never stated your requirements.
Let's start over. Forget the code you posted and tell
us: what are
your requirements? What is your goal?I'm trying to pass the value of EngiNameTextField to the table_name table
HCAF_PLCaddEngName = EngiNameTextField.getText();
this is the line of code, but i guess i have to used executeupdate
to insert values in to a table
resultSet = statement.executeQuery("INSERT INTO Table_name (Emp_name) VALUES ('"+ HCAF_PLCaddEngName+"' )");
Move = resultSet.next(); -
While executing a stored procedure which returns an integer value is giving the following Exception.
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]No ResultSet set was produced.
fdgfgdfgfdgfdgfdgfdg com.microsoft.jdbc.sqlserver.SQLServerDriver@639a3e
try
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
catch(Exception e)
System.out.println(e);
try
Connection con = DriverManager.getConnection
("jdbc:microsoft:sqlserver://servername:1433","TestUser","password");
java.sql.CallableStatement callablestatement1 = connection.prepareCall("{call QUESTION_MASTER_Add(?)}");
callablestatement1.setString(1, s);
callablestatement1.execute();
ResultSet resultset = callablestatement1.getResultSet();
The result set returned is always null.
But if I use sun.Jdbc.Odbc driver it works.
Any Idea?Try first to call getNextResultSet() method and than read from resultset...i don't have a loginc exp..but seems ot me is working
-
"no row count was produced" error using mqsl commands through Access
"no row count was produced" error using mqsl commands through Microsoft Access. This sql statement works when I use in in the Access program but it does not work when I try and put it through Access using my Java program. Here is the block of code that I have that does the search.
public static Game searchRecord(String search) throws SQLException{
String query = "SELECT* " + "FROM gamefields WHERE SKU = '" + search + "' ORDER BY SKU ASC";
Game lastGame = new Game(gamefields.getString(1),
gamefields.getString(2),
gamefields.getString(3),
gamefields.getString(4),
gamefields.getString(5),
gamefields.getString(6),
gamefields.getString(7),
gamefields.getDouble(8));
Statement statement = connection.createStatement(); //Creates connection
//statment to database
statement.executeUpdate(query); //Executes the delete query and Updates the database
statement.close();
close();
open();
return lastGame;When you use the code from java, you access access (!) through the ODBC interface. Things can be different in ODBC and Jet. When you use PrepareadStatements, you should be on the save side:
public static Game searchRecord(String search) throws SQLException
String query = "SELECT * FROM gamefields WHERE SKU = ? ORDER BY SKU ASC";
PreparedStatement statement = connection.prepareStatement(query);
statement.setString(1, search);
ResultSet rs = statement.executeQuery(query);
if(rs.next()
// if a row retuned extract the details here
rs.close();
statement.close();
return lastGame;
} -
Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) { <<<<<< ERROR LINE
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FLWagner DosAnjos wrote:
Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) { <<<<<< ERROR LINEThat looks like a driver bug. Duplicate it in a standalone program using the MS driver.
If getResultSet() returns a non-null, and the first thing yo do afterwards is call rs.next()
it shouldn't throw an exception. Download our latest driver from our site, and make sure it's
ahead of all our server stuff in the weblogic.classpath, by editing the startWeblogic script.
Joe
>
>
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FL -
No row count was produced problem
Hi i am using the SQL Server 7 and have the following problem
I am running the following query in SQL server console :
SELECT Price FROM tblPrices WHERE ItemID = 1 AND StartDate =
(SELECT MAX(StartDate) FROM tblPrices WHERE ItemID = 1)
and it gives me a correct result.
When i am using the following code:
private Connection dbCon;
private ResultSet rs;
private Statement s;
s=dbCon.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
rs=s.executeQuery(sql);
i am getting the error "No row count was produced "
i am using jdbs:odbc driver
What is wrong?
Thanks
Oifa Yulian
[email protected]The error "No row count was produced" normally happens when you run a 'select' query by using
stmt.executeUpdate(sql);
The code you have shown doesn't show that, so it looks like you either have discovered a bug no one else has found or you aren't showing us the statement which is producing the error. -
Java.sql.SQLException:Exhausted Resultset
Hi,
I am Getting java.sql.SQLException:Exhausted Resultset after filling up the form and clicking submit button so that values inserted in to Database but instead of insertion iam getting this error.
ThankQ
Regards
SaikishoreYou are trying to call a closed resultset.
check your code. if u don't find then post your relavant code
(Dhananjay Singh) -
My Mountain Lion download is stuck at "An error was produced" in the PURCHASED section. What can I do?
Help, pleasePlease help :)
-
Hi i am using Microsoft SQL server 2000 driver for JDBC (Type 4). I am having this weird error that i have no clue about.
i have this line of code where the StackTrace says that the error occurs
sqlQuery = "INSERT into KioskDB_sample.dbo.tblUserCD values ('bsharma', 'Windows XP Pro')";
rs = stmt.executeQuery(sqlQuery); //execute the query <----THIS IS THERE ERROR OCCURS
[\code]
but here is the funny and irritating part. Even though the Exception occurs the line stated above executes the query and puts the results in the database. So i have no clue why this error would occur since the line of code is executing and storing the info in the database but STILL throwing an exception. Has any one encountered anything like this before?
-bhaaratHi i am using Microsoft SQL server 2000 driver for
JDBC (Type 4). I am having this weird error that i
have no clue about.
i have this line of code where the StackTrace says
that the error occurs sqlQuery = "INSERT into KioskDB_sample.dbo.tblUserCD values ('bsharma', 'Windows XP Pro')";
rs = stmt.executeQuery(sqlQuery); //execute the query
<----THIS IS THERE ERROR OCCURS your query does not return a result set.
use executeUpdate instead of executeQuery
see this http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html
read both the executeQuery and executeUpdate methods.
your code should look like this
[code[
int rc = stmt.executeUpdate(sqlQuery);
hope things are going well. -
SQLException Scrollable Resultsets
Using JDeveloper 3.1, Weblogic 5.1, Oracle 8i
Successfully connecting to db and extracting data with vanilla prepared statements and resultsets. Not using Oracle proprietary classes.
Using oracle's classes12.zip and the ide classpath shows my classpath at the front.
Tried removing all of default JDeveloper libraries, with only my custom setup remaining.
The problem occurs at runtime from JDeveloper IDE. It all works perfectly from the command-line, but would like to have it work from IDE.
Trying to create a Scrollable Resultset from a prepared statement.
On the execution of the following statement:
pStmt = conn.prepareStatement(selectSql,
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
Getting this error:
java.sql.SQLException: weblogic.rmi.extensions.RemoteRuntimeException: Undeclared checked exception - with nested exception:
[weblogic.rmi.ServerException: A remote exception occurred while executing the method on the remote object
- with nested exception:
[weblogic.rmi.MarshalException: error marshalling return
- with nested exception:
[java.io.IOException: Class weblogic.jdbc20.pool.PreparedStatement with code=123 does not implement Serializable, Externalizable or WLSerializable]]]
at weblogic.jdbc20.rmi.SerialConnection.prepareStatement(SerialConnection.java:342)
at aces.util.ResultsetTester.main(ResultsetTester.java, Compiled Code)
It appears that the IDE runtime or compiler is forcing some classpath in front of mine and giving me an outdated jar, zip, class appended to the front that I cannot pinpoint, and I have tried many things.
I do not want to use OracleResultSet just to test in the IDE. Everything works fine if I execute from the command line.
Any concrete suggestions?You definitely don't need to be using the Sun JDBC-ODBC driver, as this will not support scrollable ResultSets. There are several drivers out there that do, ... for a list of drivers check out
http://industry.java.sun.com/products/jdbc/drivers -
I'm using RoboHelp 11 to produce WebHelp. The documentation was previously written in FrameMaker and posted in PDF format, however it has undergone many releases since those days. I'm now being asked to create the help in PDF and WebHelp. Not really an issue except that the help format does not look particularly good in PDF (not designed for both).
Ideally I'd like to just use the map file from the original Frame to RoboHelp conversion in reverse (with a little editing)--to convert the RoboHelp styles to the original FrameMaker formats when I create the PDF, however A) there doesn't seem to be an option for that, and B) the original FrameMaker to RoboHelp map file doesn't seem to have been preserved after that conversion. Is it there and I'm just not seeing it?
If necessary I can just create another CSS to redefine the styles, but if I don't have to, I rather not.I suspect that even if you could find the mapping information (pass as to where) it would simply tell you that Style A in Fm was mapped to Style B in Rh but not give you any information about how Style A was defined in Fm.
I think your only options are to create a CSS as you suggest or, as I would, create redefine the Word Style Mapping Template to suit. By going to Word first, you can edit the output for better page breaks and other tweaking you might want.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
No ResultSets were produced, Exception
Hi
We have an application running on weblogic 7.0 sp3 and SQL server as the database
Once in a while we will get an error from the system and the message will be
like this
"Statement.executeQuery - No result sets were produced by ' select * from USER_TBL
where USER_NAME = 'admin''
At this time what ever menu option we are trying to access will fail giving an"
Internal Server Error".
If we leave the system for a while and then try the same thing , the error will
go off.
Can some one advise what will be happening in the system , for not getting an
output from the query.
Thanks in advance
DNDN wrote:
Hi Joe
Thanks for the answer.
When it happened to me today in the devlopment box I am sure that is not the scenario.
There is no possibility that the table I was trying to access was locked by another
tx.
I was the only user in the system and was trying to login to the application ,
and the SELECT did not return records from the user table.
Is there anyway I can findout exactly ,why it is happening.turn on jdbc logging and maybe we'll see something in the log.
Joe
>
>
Thanks again
DN
Joseph Weinstein <[email protected]> wrote:
DN wrote:
hi Joseph
Thanks for the answer.
Would transaction has anything to do when we execute a simple SELECTstatement.
If the data you want to read is locked by another tx, then your read
could
hang until the locks were released, and by that time the coordinator
might
already try to roll it back.
DN
Joseph Weinstein <[email protected]> wrote:
Hi. I believe it has to do with when a transaction is rolled back,
and
a JDBC statement
is cancelled. I have seen several MS JDBC drivers corrupt their connection
after a
cancel() call. The one driver I have verified to work in this circumstance
is the inet
driver (www.inetsoftware.de).
Joe
DN wrote:
Hi
We have an application running on weblogic 7.0 sp3 and SQL serveras the database
Once in a while we will get an error from the system and the messagewill be
like this
"Statement.executeQuery - No result sets were produced by '
select
* from USER_TBL
where USER_NAME = 'admin''
At this time what ever menu option we are trying to access will
fail
giving an"
Internal Server Error".
If we leave the system for a while and then try the same thing ,
the
error will
go off.
Can some one advise what will be happening in the system , for notgetting an
output from the query.
Thanks in advance
DN -
Processor fan was producing lot of noise and nothing was displaying in monitor
hi
recently my call manager was not working.
while it was switching on the processor was continiously producing lot of noise
and t was not displaying nothing on monitor.
no changes was made after sucessfull running from last 5 mnths.
can any one clarify what is the problem.
thanks
regards
praveen kumar gvkhi
thanks for rply
i am having ibm server, model is 7825, the server was noot booting, nothing was displaying in monitor.
1. serever power on but it was not load into the os.
2. pci riser was installed. there is no saparate video slot.
3. monitor was connected to standard vga.
4. in the server bmc heart beat led blinking, standby power led, sas/sata controller power led is glowing.
5. hard disk drive activity led is glowing continuously.
the problem is server is not booting. nothing was displaying in monotor. all the fans are working fine. i had tried each fan they are all working. i also try to boot with single ram. but the server was not booting. -
Hi all,
can anybody point out why I get this error and what wrong am I doing. Below is the code.
Statement stmt = con.createStatement();
String query = "DELETE * from Employees where EmployeeID='"+ID+"'";
ResultSet RS = stmt.executeQuery(query);
Thanks
kiranHi,
In your case you should use stmt.executeUpdate(query). You don't need any resultset.
If you have a time take a look at java.sql.Statement interface in API reference. -
NoSuchfieldName error while compiling a class that was produced by sqlj
hello all,
could you please tell me where the following error code came from when i
tried to execute java TestInstallSQLJ?
I could use sqlj TestInstallSQLJ.sqlj to translate it into java code, but
then....
thank you for your help.
Exception in thread "main" java.lang.NoSuchFieldError
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Error.<init>(Error.java:50)
at java.lang.LinkageError.<init>(LinkageError.java:43)
at
java.lang.IncompatibleClassChangeError.<init>(IncompatibleClassChangeError.java:43)
at java.lang.NoSuchFieldError.<init>(NoSuchFieldError.java:45)
at
oracle.sqlj.runtime.OraDynamicClosure.getSQLType(OraDynamicClosure.java:68)
at
oracle.sqlj.runtime.OraBasicClosure.<init>(OraBasicClosure.java:47)
at
oracle.sqlj.runtime.OraClosureFactory.addStandardTypes(OraClosureFactory.java:138)
at
oracle.sqlj.runtime.OraClosureFactory.get81Closures(OraClosureFactory.java:50)
at
oracle.sqlj.runtime.OraClosureFactory.getTypeClosures(OraClosureFactory.java:33)
at
oracle.sqlj.runtime.OraCustomization.getProfile(OraCustomization.java:95)
at
oracle.sqlj.runtime.OraCustomization.getProfile(OraCustomization.java:87)
at sqlj.runtime.profile.ref.ProfileImpl.getConnectedProfile(Compiled
Code)
at
sqlj.runtime.ref.ProfileGroup$ConnectedGroup.getProfile(ProfileGroup.java:154)
at
sqlj.runtime.ref.ConnectionContextImpl.getConnectedProfile(ConnectionContextImpl.java:183)
at
sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:279)
at TestInstallSQLJ.runExample(Compiled Code)
at TestInstallSQLJ.main(TestInstallSQLJ.java:56)following is my environment:
sqlj -version-long
Oracle SQLJ Release 8.1.6.0.0 - SDK
Build version: 1.0.4.4 - Built on Apr 14, 1999
IDE interface version: 8.1.6.0.0/1.0.4.4
JDBC version: non Oracle driver version 0.0 (0.0.0.0)
java -version
java version "1.2.1"
Solaris VM (build Solaris_JDK_1.2.1_03, native threads, sunwjit)
echo $PATH
a long path +
/examples/sqlj/bin
echo $CLASSPATH
a long CLASSPATH +
/examples/sqlj/lib/translator.zip:
oracle JDBC driver8.1.7
it translated my sqlj files but then it can't interprete my java classes.
thank you a lot for your help
Maybe you are looking for
-
Calendar Sync for Palm and encryption
We are converting our Calendar Server to always use encryption. We're not finding any way to specify the encryption in the Calendar Sync conduit. Did we miss it somewhere? If not, how do we force the Calendar Sync for Palm to use encryption?
-
Adobe premiere CC crash on quit
Each and every single time I quit Premiere Pro CC it crashes. I get the spinning ball or death then I'm asked to send a report to Apple and Adobe. Have the most recent version of the program, I've cleared all my preferences and caches. What would be
-
Im trying to find a good monitor to use at home for Graphic Design, Web Design and 3D animation. I have 2 x 20" Samsung displays that are only 1600x900 res. I found a couple of brands that Im considering but would like feedback if anyone has used or
-
Hi all: I had a failed delta load from R/3 ( Cost Centers: Actual Costs Through Delta(0CO_OM_CCA_9) ) to our BW Production System . We deleted the requests that failed . We tried doing re-construct but it says the previous delta has not finished .Is
-
I do not have the software to reboot my computer. How do I find out what my administrator ID and password are?