JDBC Driver issue with SQL Server 2008

Hi,

I just migrated to SQLServer 2008 Express from the 2005 version. I
have a Java application that uses SQL JDBC Driver (sqljdbc4.jar -
latest version) to connect to DB. I had to upgrade to the latest
driver as the previous version sqljdbc.jar did not work with SQL 2008.
Now my application works, but in one instance it fails. Debugging i
found the issue to be when accessing this particular stored procedure
that has both Update and Select queries.

In this case the error says 'statement didnt return a resultset' when
executing this code
'preStmt.executeQuery();'

This issue didn't occur with SQL server 2005 and the older jdbc
driver, its only after i did the upgrade. Is this a new limitation in
SQL 2008 or is there a different way to access such a query or is
there a way to stop this in the query itself ???

The main function of the store procedure is to retrive results so i
had to use executeQuery, but it is also essential to do some updates.
So without breaking the query, is there a way to get round this.


snippet of the query:
  UPDATE country SET accessed = 1 WHERE countrysid = 3
  SELECT name,age,address FROM person WHERE country = 3

java code:
      PreparedStatement preStmt = commonConnection.prepareStatement(
        "{call pGetPersonList(?)}");
      preStmt.setInt(1, statusid);
      ResultSet rset = preStmt.executeQuery();
      while(rset.next()){
          // statements
      }

Thanks for your time,
Dragonfruit.

0
Shiran
3/31/2010 9:36:09 AM
sqlserver.server 1327 articles. 0 followers. Follow

1 Replies
969 Views

Similar Articles

[PageSpeed] 4

On 2010-03-31 11:36, Shiran wrote:
> I just migrated to SQLServer 2008 Express from the 2005 version. I
> have a Java application that uses SQL JDBC Driver (sqljdbc4.jar -
> latest version) to connect to DB. I had to upgrade to the latest
> driver as the previous version sqljdbc.jar did not work with SQL 2008.
> Now my application works, but in one instance it fails. Debugging i
> found the issue to be when accessing this particular stored procedure
> that has both Update and Select queries.
>
> In this case the error says 'statement didnt return a resultset' when
> executing this code
> 'preStmt.executeQuery();'
>
Try SET NOCOUNT ON at the top of the procedure body or remove it if it's 
there (or even SET NOCOUNT OFF). Whether or not this does/does not confuse 
the driver depends on the version and what method you're calling to execute 
the query, so it may or may not work. It should not confuse any native 
clients (ODBC and .NET) calling the procedure, but this is not absolute either.

-- 
J.
0
Jeroen
3/31/2010 8:04:39 PM
Reply:

Similar Artilces:

Exadmin Virtual Server
Hello All, I accidently deleted my default Web Site after I had installed Ex2k3. Now I cannot connect to my public folders with Systems Manager. I have read KB-282125 in regards to fixing this issue. They suggest running setup again, however I'm unsure of the effects of running through the setup process on an established mail server (not to mention its in production). Any advice or confirmation on the above course of action would be greatly appreciated! TIA, Andrew You would need to reinstall and reapply your service pack which would temporarily stop your services. If you are...

Frequent Crashes for All Office 2008 Apps
Hi everyone,<br> <br> I've been reading through the posts and have a recurring problem of frequent crashes by all Office 2008 applications: Word, Excel and Powerpoint. I can usually get about 20 minutes of work done then the applications will start to crash.<br> <br> I've been reading through these boards for help. From the posts, I tried the following to no success: 1) Deleted all com.microsoft files from the Preferences folder; 2) deleted the Microsoft folder from Preference; 3) deleted normal.dot.<br> <br> I did have Office 2004 and even some old ...

Critical System Driver missing! 0xc0000225
Hello, I'm new to the forum so if this post thread is in the wrong section I'm sorry anyway. I have had my vista for quite a while had some errors and viruses here and there but this has never happened before. Whenever I turn on my computer the "-Windows Boot Manager-" comes up saying. - File: \Windows\System32\Drivers\hpldzgl.sys Status: 0xc0000225 Info: Windows Failed to load because a critical system driver is missing, or corrupt.- This error message first come up when i turned on my computer it booted up was on the desktop I went to get a drink, came ...

mail server relaying
i I posted a question about 2 days ago, my exch 2k server is relaying messages from users that dosen't belong to my domain to users that also dosen't belong to my domain. The smtp queue is a mile long and I can see a great amount of the mesages being delivered. I checked the relaying option on the SMTP virtual server. I have the settings as follows 1) Access Granted to my lan 192.168.1.0 2) I also allow users who successfully authenticate to relay through my server. One other note, on my Outbound security tab, I have Anonymous access selected, is this ok? Any ...

Need Driver Help after re-installing XP Pro!!
I was having some problems with my (somewhat old) Dell Dimension D600 laptop so I decided to do a clean install. Everything went well except now my Device Manager shows no drivers (question marks) for: Ethernet Controller Network Controller PCI Modem Video Controller I have no chipset install disk for this computer so using my other computer, I went to the Dell web site and downloaded what I thought were a series of drivers. The file is named DellDriverDownloadManager.application. I then copied this file to my Dell laptop but it will not open except as a text file in note...

JDBC Driver issue with SQL Server 2008
Hi, I just migrated to SQLServer 2008 Express from the 2005 version. I have a Java application that uses SQL JDBC Driver (sqljdbc4.jar - latest version) to connect to DB. I had to upgrade to the latest driver as the previous version sqljdbc.jar did not work with SQL 2008. Now my application works, but in one instance it fails. Debugging i found the issue to be when accessing this particular stored procedure that has both Update and Select queries. In this case the error says 'statement didnt return a resultset' when executing this code 'preStmt.executeQuery();' ...

Restoring Exchange Server 2000 with SP1
hi everybody, I have difficulty in restoring an Exchange server 2000 wtth SP1. The recovery process using eseutil /cc Ended with the following error Error returned from an ESE function call (-1811). Operation terminated with error -107 (JET_errInternalError, Fatal internal error) after 0.110 seconds. Any Suggestions on this will be appreiciated. Thanx for ur time. regards deena. Hi Take a look at the following two Microsoft KB articles: http://support.microsoft.com/kb/266689/ http://support.microsoft.com/default.aspx?scid=kb;en-us;810199 Are you running a cluster? if so look at the firs...

In Test Account login, how get 2008 to see current identity? Test Acct vs. Safe Boot?
1. If I log into the Test Account I created in the System folder and then launch Entourage, the setup assistant wants to import an Office 2004 identity rather than give me an option to use the current identity created with Office 2008. Your counsel, please? 2. If there are no problems in running Office 2008 component applications when in Safe Boot startup mode, how would re-booting into Normal startup mode and logging into Test Account help in isolating/diagnosing problem causes? Respectfully, Norm On 1/28/08 12:09 PM, in article C3C37661.1E4C%nnager@vnoxsxpxaxmv.fullerton.edu, "...

FetchXml to SQL Query
I'm looking for a tool that converts FetchXml to equivelent SQL Query. Can you help? Not aware of anything that does this. If you are fairly handy with XML though it shouldn't be that difficult to write. -- Matt Parks MVP - Microsoft CRM "CRM Chief" <CRMChief@discussions.microsoft.com> wrote in message news:600AB470-BCA8-48F9-9CD8-652835945661@microsoft.com... I'm looking for a tool that converts FetchXml to equivelent SQL Query. Can you help? ...

Forwarding Issue Using Outlook 2007
I'm using Windows 7 Ultimate and Outlook 2007. Recently, I've become unable to successfully forward messages in Outlook 2007. When I attempt to do so, I receive a mail delivery error. It also occurs if I attempt to copy and paste the message information from the e-mail that was returned with the error into a new message and send. I can send a new message just fine. I can send a message with large file attachments just fine. I can reply to messages without problems. My only problem right now is with forwarding. Any ideas? Thanks. What is the exact error that...

Front-end server
Hi, I have fairly simple environment as shown in Front-end topology guide. I am using advanced firewall in DMZ. So, it is like Internet > Internet firewall <ISA> >Internal Firewall > Front-end > Back-end cluster. In this case, do i need to configure any other things?; apart from just placing a check-mark for front-end server... do i still need to manally create virtual directories on FE and BE ? I want to publish OWA and configure it as SSL bridging. my understanding is that i just need to enable Front-end setting using ESM. Yes that would work once you reboot your ...

6 in 1 combo driver-need a driver
I have a USB-HUB 6 in 1 combo card reader with 3 USBs that I need to attached to my laptop that only has one USB (work laptop, not my choice). When connected it says "USB not recognized" ; I have seen this in the past and have removed the battery and still says the same thing. I had it working, although everytime I bumped it, it would install and uninstall.....I looked at properties and it does not have a driver, and no roll back driver , of course. I have looked but most programs do not autodetect this device. My combo has no identifying name and I bought in on line...

me.recordsource issue
Hi. I have built a tabular form and trying to populate the data from a table which is not in its .mbd file. So i have set the rst object to that mdb file from where i want to fetch the data but when i am saying me.recordsource = rst it is not correct. And if i say me.recordsource=rst.source then i get error the table not found and it is because the code is searching the table within its mdb file. Please help. Thanks in advance. Regards, Why don't you just create a linked table to the external data in your current database? Steve <ashina.w2@gmail.com> wrote in message news:1...

Exchange 5.5 to 2003 and Global catalog server/DC
Hello, I recently installed Exchange 2003 on a new server in our domain. This is not the first Exchange 2003 server installed here. When i tried to migrate a user i got the following error message: The information store could not be opened. The logon to the Microsoft Exchange Server computer failed. MAPI 1.0 ID no: 80040111-0286-00000000 When i searched for a solution I believe I found one. They suggested that the problem is being caused by the fact that the Exchange 5.5 server is also a DC that holds the global catalog. My question is that if I uncheck the GC option is ADSS what will...

SQL Reports- change database automatically based on GP company
Anyone know how to automatically have a SQL report change the data source based on the GP company a user is logged in to? What are some workarounds to use? -- Janey Janey, I believe Crystallizer does this: http://synergistix.net/products/crystallizer/. Despite the name it will work with both Crystal and SRS reports. -- Victoria Yudin Dynamics GP MVP Flexible Solutions, Inc. "Janey" <Janey@discussions.microsoft.com> wrote in message news:8DB8BF87-AE07-487A-B677-EF26EDBD4E12@microsoft.com... > Anyone know how to automatically have a SQL report change the data so...

integrate Activex control(OCX) object into ATL COM Server DLL project
I need to integrate Activex control(OCX) object into ATL COM Server DLL project. I created a dialog in my the project and added activex control. After adding the ActiveX control my other parts of the program are not working properly. The COM DLL calls CoCreateInstance() to connect to another component. At this point it hangs. If I remove the ActiveX object from the project everything works fine. Do you guys have any idea? ...

Adding a 2nd exchange server to an existing site.
We are looking to add a 2nd Exchange 2003 server to our org. We would like to have this server offsite in case of natural disater, power outage etc. Is there any way that both servers can have an up to date mailbox store for the users without 3rd party tools to synchronize this? Also- if not, why is this the case? Also would we need to adhere again to Microsoft licensing for this server or would our current cals and license still be legit? Thanks for your help. -- Mr.Max You are talking about a DR or GeoClustering solution and there is no way to do this natively in Exchange. You will...

Installation Issue
I have just installed CRM 1.2 Professional - I was able to install the 1.2 client locally. On a VPN connection, I can't seem to access the server - I tried to installed the client and it's asking for the website, but it can't be found. Do I need to allow remote access or some other approach? Thank you See if you can get to the CRM server via a web browser. If you can access it by name, it's probably related to open ports. If you can't, it's a name resolution issue. "tony" wrote: > I have just installed CRM 1.2 Professional - > I was able to ins...

Exchange Server Backup (HELP)
I have been using the ntbackup to do backup on my exchange server, I read some place that you may need to also backup the logs if you intend restore your exchange data store one day. Is this true? What I have done was use the Backup Utility and select Microsoft Exchange Server, and then my exchange server. This gives me my "Microsoft Information Store - and First Storage Group, that consists of Mailbox Store and Public Folder Store. No place here shows the logs. Can anyone give me a good suggestion on backing up my exchange server. I am thinking of testing this on my bench ...

Does microsoft supplies jdbc driver for microft access?
SUB- jdbc driver required for ms-access to access it from a client terminal. ...

Outlook 2008 Trial version
I installed a trial version of Outlook 2008. I entered the product code. It won't let me send email or reply to emails. It says that in order to do so, I have to purchase a licensed copy of Microsoft Office. Does that mean I can not fully use the email in the trial version unless I buy the software? There is no such thing as Microsoft Office Outlook 2008 for Windows. = Tell us what you really have. --=20 Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After furious head scratching, Lynne asked: | I installed a trial version of Outlook...

SERVERS
Help i have set up my email address [etc] with windoow's mail, everything is fine until itry to send a message error's ocur with my server's ihave contacted my server's but they tell me who they are i have typed them in but windows say not valid. is there any other way to find out please. Sorry, but this newsgroup is for questions about Access, the database product that's part of Office Professional. You'd be best off reposting your question to a newsgroup related to Window Mail, such as microsoft.public.windows.vista.mail Note, too, that you should never incl...

JDBC-ODBC Bridge driver & ODBC driver are two different installati
http://www.paphoscarhire.mobi/odbc-bridge2.jpg desktop control panel settings, I have above URL (IMG) Settings well, I need to run in my PC: Type 1 db driver Access / java[SE1.6] Desktop Applications, what I need to install ? I refer for Type 1, JDBC-ODBC Bridge driver.... Is it needed install and Access 2003 ODBC driver (see URL) ...? How I understand if I already installed it(?) since I do not know ? JDBC-ODBC Bridge driver & ODBC driver are two different installations? How to load driver in my program ? The below are correct for: Class.forName & DriverManager.ge...

DST Issue Discovered
Since I installed the DST patch, I realized that I could not add or update and attribute in CRM. Looking through old posts on this forum, it lead me to believe there was an issue with the Microsoft.Crm.MetadataService.dll Turns out I had to reload the Global Assembly Cache using the gacutil.exe tool. Must be a version issue with the .NET Framework when the DST patch was installed. If you haven't already, see if you can update/add any attributes, James ...

Business Portal 2.5/SQL 2005/Great Plains 8.0
Has anyone been able to get Business Portal 2.5 with SQL 2005 and Great Plains 8.0? We have heard that that they work together. -- Chuck N If you have GP sp4a, you can use SQL 2005. I am not sure about BP though. "Chuck N" wrote: > Has anyone been able to get Business Portal 2.5 with SQL 2005 and Great > Plains 8.0? We have heard that that they work together. > -- > Chuck N Chuck and David, The Business Portal system requirements state: "Business Portal Release 2.5 is not supported with Microsoft SQL Server 2005." -- Donna Marshall Technical Writer...