Showing posts with label jdbc. Show all posts
Showing posts with label jdbc. Show all posts

Monday, March 26, 2012

Invalid operation for the current cursor position

Our developers are getting the following error posted from several Java
applications.
[Microsoft][SQLServer 2000 Driver for JDBC] Invalid operation for the
current cursor position
Is anyone familiar with this error?
Khris wrote:

> Our developers are getting the following error posted from several Java
> applications.
> [Microsoft][SQLServer 2000 Driver for JDBC] Invalid operation for the
> current cursor position
> Is anyone familiar with this error?
It can occur when you try to access result set data without ever
having called next(). If you can show us the whole original stack trace
of the exception and the code that caused it, we can probably see the problem.
Joe Weinstein at BEA Systems
|||Joe - you are correct. The developer was not validating that there was an
actual row. Thanks a bunch
"Joe Weinstein" wrote:

>
> Khris wrote:
>
> It can occur when you try to access result set data without ever
> having called next(). If you can show us the whole original stack trace
> of the exception and the code that caused it, we can probably see the problem.
> Joe Weinstein at BEA Systems
>

Friday, March 23, 2012

Invalid object name one_two_threefour_five_six11.

Hi,

I am trying to connect sql server 2005 with JDBC driver from a java program.(got from microsoft).It is simple class that retreving all the data of table.

i am doing "select * from one_two_threefour_five_six11 " . But it is giving
Exception of type 'com.microsoft.sqlserver.jdbc.SQLServerException Detail Message: Invalid object name 'one_two_threefour_five_six11'.

But the table is there in the database i given in configuration.This program is working for other tables. when i do the same query in Query analyzer it is showing data.

Please help me..

Thanks in advance.

venkateither something is wrong with your connection string or there is a ownership or permissions issue.|||Personally, I think sql server is making fun of you with a table_name like that

Check the owner|||Try this query instead:

select db_name()sql

Wednesday, March 21, 2012

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

sql

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

Invalid non-ASCII character conversion over JDBC to Solaris client

Hi,

I'm working on a database conversion from Sybase to SQL Server 2005 and have hit a wall with a character conversion problem when reading non-ASCII characters (encrypted password) via JDBC.

My application runs on Solaris and accesses a SQL Server 2005 database via the Microsoft JDBC driver. The server was unfortunately specified as having a SQL_Latin1_General_CP1_CI_AS collation at installation time, and the database being accessed has taken this default. After creation the data was migrated across via DTS.

The invalid character is a dagger '?'. When read over JDBC it is converted to a question mark '?'.

In my original environment a Sybase database was accessed via JDBC driver from Solaris and the correct value was returned. The Sybase database used Latin1_General_BIN as it's collation. By way of experimentation I have modified the default collation sequence within the SQL Server 2005 database, and created a new table to hold the password. I am then able to correctly return strings containing this character from within SQL Server Management Studio, but the same problem still exists when accessing it via JDBC.

I am not sure where to focus my investigation and would be grateful for any useful pointers/advice. To me it looks like it's a JDBC driver issue as with the change in collation it works from a non-JDBC client.

Many thanks

Alistair

Just to make sure we are on the same page, are you using the Microsoft 2005 Jdbc driver?

http://msdn.microsoft.com/data/ref/jdbc/

We have just shipped the June community tech preview of this driver if you want to play with the latest and greatest:

http://www.microsoft.com/downloads/details.aspx?familyid=f914793a-6fb4-475f-9537-b8fcb776befd&displaylang=en

The Microsoft 2000 Jdbc driver is not supported here. If you are using the latest driver do you have some code that inserts the invalid data into the database and then returns it incorrectly? I would be happy to take a look at this.

|||

Thank you for the reply. I have been using the 2005 driver, but have managed to resolve the problem by changing the column data type to a binary rather than varchar.

Out of interest do you have any idea when the new driver will go on general release?

|||

Glad to hear you got this working!

We are currently working on shipping the v1.1 release of the 2005 JDBC driver, of course I can't promise anything but we are targetting an August release date.

|||

Hi,

Please can you update me on the shipping date for the v1.1 release of the 2005 JDBC driver? Is it likely to be within the next couple of weeks?

Regards,

Alistair

|||

Hi Alistair,

Yes, the v1.1 release should be available within the next couple of weeks. It may even be available as early as next week.

Thank you,

--David Olix

JDBC Development

Friday, February 24, 2012

interupt JDBC SQL query connection

Hi

I using Java and JDBC to connect to MS SQL server 2000 (using the MS
drivers msbase,msutil and mssqlserver.jars).

Sometimes it takes a long time for statement.executeQuery
to return and start returning the resultset
(full DB scan can take 30-40 minutes).

Does anyone know if it's possible to interupt/halt the query before
it eventually comes back. The setQueryTimeout works OK but this has to be
set quite high to allow real queries to run correctly. What I'm trying
to do is allow users to halt their query if they've realised they
want to alter it or its taking too long. The query is running in a
separate thread and I've tried using the main thread to close the
connection or stop the query but this still waits until the resultset
is returned.

Maybe it's a driver issue or ....

Thanks
MikeHi

I am not sure about the JDBC driver itself, but you could use a timer thread
to kill it off.

John

"Mike Read" <mar@.roe.ac.uk> wrote in message
news:Pine.OSF.4.58.0406091501320.263861@.reaxp06.ro e.ac.uk...
> Hi
> I using Java and JDBC to connect to MS SQL server 2000 (using the MS
> drivers msbase,msutil and mssqlserver.jars).
> Sometimes it takes a long time for statement.executeQuery
> to return and start returning the resultset
> (full DB scan can take 30-40 minutes).
> Does anyone know if it's possible to interupt/halt the query before
> it eventually comes back. The setQueryTimeout works OK but this has to be
> set quite high to allow real queries to run correctly. What I'm trying
> to do is allow users to halt their query if they've realised they
> want to alter it or its taking too long. The query is running in a
> separate thread and I've tried using the main thread to close the
> connection or stop the query but this still waits until the resultset
> is returned.
> Maybe it's a driver issue or ....
> Thanks
> Mike|||how many people here get the luxery of creating and maintaining apps in
jbuilder and together everyday? care to share any stories, either great
or not so great! i just got an eval of the latest and greatest installed
and after using previous versions for years, what i see now looks really
great. just was wondering about your experiences.

cheers

- perry|||I'm just new in the Java World and also JBuilder X Enterprise IDE. I'm
making a servlet client , using Struts , because the MVC pattern is just what
we need for our application.
Until now this is working just fine. I like the IDE, autocompletion, colors,
indent, etc.
The progam gives a lots of tips and help using class, packages, etc.

Greetings....

In comp.lang.java perry <perry@.cplusplus.org> wrote:
: how many people here get the luxery of creating and maintaining apps in
: jbuilder and together everyday? care to share any stories, either great
: or not so great! i just got an eval of the latest and greatest installed
: and after using previous versions for years, what i see now looks really
: great. just was wondering about your experiences.

: cheers

: - perry

--
Alfredo Diaz
================
School of Engineering and Science, University of Chile
Beaucheff 850, P.O. Box 2777, Santiago, CHILE
mailto:aadiaz@.dcc.uchile.cl.nospam|||Mike Read (mar@.roe.ac.uk) writes:
> I using Java and JDBC to connect to MS SQL server 2000 (using the MS
> drivers msbase,msutil and mssqlserver.jars).
> Sometimes it takes a long time for statement.executeQuery
> to return and start returning the resultset
> (full DB scan can take 30-40 minutes).
> Does anyone know if it's possible to interupt/halt the query before
> it eventually comes back. The setQueryTimeout works OK but this has to be
> set quite high to allow real queries to run correctly. What I'm trying
> to do is allow users to halt their query if they've realised they
> want to alter it or its taking too long. The query is running in a
> separate thread and I've tried using the main thread to close the
> connection or stop the query but this still waits until the resultset
> is returned.

You will have to examine the documetation for the JDBC driver. Most
client APIs for SQL Server supplies functions for asynchronous calls.
With a asynch call, you could then issue a cancel request (again this
is offered by most client APIs).

microsoft.public.sqlserver.jdbcdriver may offer more exact answers with
regards to that driver.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp