SQL Server 2000 and JDBC,Registering cursor as OUT param

hi
I am using JDK1.4,SQL Server 2000 and Microsoft's JDBC driver.
I am stuck in accessing cursors.
The SP i wrote is
USE pubs
IF EXISTS (SELECT name FROM sysobjects
WHERE name = 'spSelectEmployees' and type = 'P')
DROP PROCEDURE spSelectEmployees
GO
CREATE PROCEDURE spSelectEmployees @emp_cursor CURSOR VARYING OUTPUT
AS
SET @emp_cursor = CURSOR
FORWARD_ONLY STATIC FOR
SELECT *
FROM employee
OPEN @emp_cursor
GO
The problem I face is that when i register the output param in java code,what datatype do I specify..code is written below.
calStmt = conn.prepareCall("{CALL pubs.dbo.spSelectEmployees(?)}", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
calStmt.registerOutParameter(1,Types.?????);-->What goes here???
java.sql.Types does not give any datatype for cursor or object.Any one knows if there is an extended type given by Microsoft Driver??

I am using JDK1.4,SQL Server 2000 and Microsoft's JDBC driver. Premably for 2000. Numerous posts here suggests that driver has problems. The jTDS driver would be a better choice.
java.sql.Types does not give any datatype for cursor or object.Any one knows if there is an extended type given by Microsoft Driver??You are correct that it would require a driver specific type. I have no idea what it is.
Why don't you modify the proc to return a result set.

Similar Messages

  • MS SQL Server 2000 and JDBC Driver Problem

    I was wondering if you could help me. I installed Java 1.4.1 on my Win2K machine along with MS SQL Server 2000 JDBC Service Pack 1 drivers.
    The drivers and JDK installed perfectly and I properly set my class path. Yet everytime I try to execute my code I get the: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver error.
    Any idea why? Is it posisible that the JDBC drivers are not comaptible with Java 1.4? I also installed 1.3.1 and I get the same issue. Let me know if you have any insisghts. Much thanks.
    [email protected]

    Those drivers are perfectly compatible with JDK 1.4.1. I've used them successfully.
    CNF Exception ALWAYS means that the class loader can't find the JAR in the CLASSPATH. You said you "properly" set your CLASSPATH. Am I right in assuming that you mean a Win2K environment variable?
    I think that's a bad idea. I don't have one on my machines at all.
    I always set the CLASSPATH myself when I compile and run an app, to make sure that I always have exactly what I need.
    If you're running Tomcat, it doesn't even look at the system CLASSPATH as far as I know. If you're using this in a Web app, but those JARs in your WEB-INF/lib directory and deploy your stuff as a WAR file. Tomcat will find it in the CLASSPATH for sure then.
    Let me know if either of those suggestions hits the mark. If not, send more info and I'll try again. - MOD

  • JDBC to access SQL server 2000 and Oracle.

    hi,
    I have the following requirement. I have an oracle database which contain sql data including BLOB and CLOB. Firstly, I should migrate the data to a SQL server 2000 database. That is, i should be able to have two databases, one on oracle and the other on sql server 2000. the two databases should contain the same data, which includes BLOB data. I guess, sql server 2000 does not have a BLOB data type. What is the equivalent data type i can use to save the Oracle's BLOB data in SQL server?? Should it be image type?
    After i migrate the data to the sql server 2000 database, i should be able to connect to the two databases, oracle and sql server 2000, using the same JDBC code to retrieve, insert, update and delete the data. What are the drivers that i should use. I guess, the MS JDBC driver does not support BLOB and CLOB. Is there a driver that can support BLOB for sql server 2000 and is also free???!
    Kindly help... Thanks.
    Arthi.

    Hi,
    I am new to jdbc... so, pls forgive my ignorance...
    I shall try to map a BLOB data column in oracle to an IMAGE data column in sql server 2000. I am using oracle jdbc driver and microsoft's jdbc driver for connecting to the databases.
    My question is, can i use setBlob() method in the preparedstatement in jdbc code for setting data to the sql server 2000 image column?
    rs.getBlob() and preparedstatement.setBlob()code works fine for oralce's BLOB column using oracle's jdbc driver.... Will the same jdbc code work for sql server 2000's image column using microsoft's jdbc driver??
    Kindly help.
    Arthi.

  • Connect SQL Server 2000 using JDBC

    Hi all,
    We have installed the microsoft sql server 2000 into 3 different pcs which is not the server. we have installed the jdbc driver into the server and wish to connect the database from the 3 pcs using that jdbc driver from the server. may i know is it possible to connect the database and if it is possible, the database url is it something like      jdbc:sqlserver://<host_name>:<port>;DatabaseName=<db_name>?
    Also may i know what is actually the host name? like is it the host name of j2ee engine or the ip address where the database resides in. also for the port is it 1433 for microsoft sql server 2000 and if it is fix meaning that only 1433 is the port for sql server 2000?
    Thanks

    Hi,
    see <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=48126">this Thread</a>
    HTH,
    Carsten
    The hostname is the name (or IP-Adress) of your PCs. The Port of SQL Server may vary, but by default it is 1433.

  • Unable to install SQL server 2000 and 2005 on Satellite A205-s5831

    Hello everyone.
    I Needs some helps from all of you.
    I have Toshiba Laptop Satellite A205-S5831.
    Its Have Windows Vista Home Premium.
    And I am unable to install SQL server 2000 and 2005.
    I also Unable to Install Windows XP SP2.
    Problem is SATA driver.
    Plz Help me ...!
    Response me

    Hi
    The Windows XP needs a SATA driver if you want to install it on the notebook with SATA HDD controller.
    The SATA driver can be found in the Intel Storage Manager.
    I would recommend using the nLite program to include a SATA driver into the new Windows XP CD and then to boot from the new created XP CD.
    Here you will find all details regarding the nLite:
    http://www.nliteos.com/
    Regarding SQL server issue;
    Maybe you will be able to install in on Windows XP. Possibly there is a compatibility issue between the Vista and the SQL server software

  • SQL Server 2000 and 2008 Standard Edition

    Hi,
    I was wondering if anyone knows if there are any auditing limitations in the standard editions of SQL server 2000 and 2008 R2.
    I'm interested to know if there are audit functions for user auditing like creation, deletion and logons
    Can't seem to find any information about this.

    In addition to Shanky notes, please  have a look at these article:
    DML Trigger Status Alerts
    Implementing generic audit trail trigger in sql server
    Saeid Hasani [sqldevelop]

  • How to insert chinese data into MS SQL Server 2000 through JDBC

    I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
    can anybody help me.
    thanx.

    I am trying to insert chinese data into MS SQL server 2000 using JDBC. how to do this?
    can anybody help me.
    thanx.

  • How to connect Sql Server 2000 using JDBC ODBC Driver

    How to connect Sql Server 2000 using JDBC ODBC Driver ?
    plz Send Syntax.
    thanks

    In SQL Server 2000 the driver class is com.microsoft.jdbc.sqlserver.SQLServerDriver
    The connection URL for the default SQL Server 2000 database is jdbc:sqlserver://localhost:1433
    Class.forName(
      "com.microsoft.sqlserver.jdbc.
      SQLServerDriver");
    String url =
      "jdbc:sqlserver://localhost:1433";
    Connection conn = DriverManager.
      getConnection(
      url, "sa", "sqlserver");

  • How do SQL server 2000 and Oracle linked?

    Hi,
    How do SQL server 2000 and Oracle linked?
    Thanks in Advance
    Baloch.

    use the like to setup ODBC and datasource
    http://www.databasejournal.com/features/oracle/article.php/3442661/Making-a-Connection-from-Oracle-to-SQL-Server.htm
    and then create link server in sql server after you test conenction with oracle

  • Communication Failing with Corrupted Chars . Sql Server 2000 and AS400

    Hi Experts,
    I am facing this below error after 9 yrs. sql server 2000 and As400 on prod server. while on dev and stage it's running properly. Here username is ABCD, while it's showing BCD
    The OLE DB provider "MSDASQL" for linked server "" reported an error. Authentication failed. [SQLSTATE 42000] (Error 7399) Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "xxxxx".
    [SQLSTATE 42000] (Error 7303)  OLE DB provider "MSDASQL" for linked server "" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed".
    [SQLSTATE 01000] (Error 7412)  OLE DB provider "MSDASQL" for linked server returned message "[IBM][iSeries Access ODBC Driver]Communication link failure. comm rc=8001 - CWBSY0001 -
    User  BCD on server does not exist, Password length = 8, Prompt Mode = Never, System IP Address = "xxxxx". [SQLSTATE 01000] (Error 7412).  The step failed.
    Here ABCD user is also disabling/locking the profile on AS400 server.
    When we tried on Dev server, linked server through DSN working properly. Last time when it appeared 2 yrs ago, it resolved automatically. but now more than 10 days passed and still Failing.
    Please Guide Me.
    Regards,
    Manish

    So this setup has worked for nine years, and all of a sudden stopped working with this error message? Does not look trivial...
    What does Here ABCD user is also disabling/locking the profile on AS400 server mean? Is ABCD able to log in directly on the AS400 box?
    One possibility is that the user ABCD has been dropped or disabled, and then there is a bug in the ODBC driver where the first character of the username is distorted in the error message. I note that there are two spaces between "User" and "BCD".
    The other possibility is that the AS400 is receiving a login attempt from BCD (or something that ends in BCD with an invisible leading character). This sounds very difficult to troubleshoot...
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL Server 2000 and BPEL configuration issues

    I am attempting to get SQL Server 2000 to work with BPEL PM Server, and have followed a similar set of instructions as provided in a previously posted document regarding the switch from oracle lite to oracle production. I am following the OC4J route. I've seen a previous posting on this, however, I am elaborating a little more on the configuration details here and the difficulties that I am encountering.
    I'm am using the following software:
    1) SQL Server 2000 (w/ SP3)
    2) SQL Server 2000 JDBC Driver (SP3 latest version)
    3) BPEL PM (GA release)
    Here's what I've done:
    1) setup the database in SQL Server 2000 (named: ORABPEL). then ran the ddl scripts that came with the BPEL installation for sql server. there were two scripts, one for domain and the other for server. the commandlines to run these scripts:
    sql -Uuser -Ppassword -ddatabase
    -i c:\orabpel\system\database\scripts\domain_sqlserver.ddl
    -o c:\orabpel\system\database\scripts\domain_sqlserver.out
    2) installed stored procedures for JTA. this is documented in the JDBC driver help file.
    3) modified the library paths in application.xml as followed:
    <!-- SQL2K JDBC LIBS -->
    <library path="C:\Program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar"/>
    <library path="C:\Program files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar"/>
    <library path="C:\Program files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar"/>
    4) modified the datasources in the data-sources.xml:
    - first comment out the oracle lite data-source
    - add datasources for mssql 2000:
    <data-source class="com.evermind.sql.DriverManagerDataSource"
         name="BPELServerDataSource"
         location="loc/BPELServerDataSource"
         xa-location="BPELServerDataSource"
         ejb-location="jdbc/BPELServerDataSource"
         connection-driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
         url="jdbc:microsoft:sqlserver://127.0.0.1:1433;SelectMethod=cursor;User=<username>;Password=<password>;DatabaseName=ORABPEL">
    </data-source>
    <data-source class="com.evermind.sql.DriverManagerDataSource"
         name="BPELSamplesDataSource"
         location="jdbc/BPELSamplesDataSource"
         xa-location="BPELSamplesDataSource"
         ejb-location="jdbc/BPELSamplesDataSource"
         connection-driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
         url="jdbc:microsoft:sqlserver://127.0.0.1:1433;SelectMethod=cursor;User=<username>;Password=<password>;DatabaseName=ORABPEL">
    </data-source>
    <data-source class="com.evermind.sql.DriverManagerDataSource"
    name="AdminConsoleDateSource"
    location="jdbc/AdminConsoleDateSource"
    xa-location="AdminConsoleDateSource"
    ejb-location="jdbc/AdminConsoleDateSource"
         connection-driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
         url="jdbc:microsoft:sqlserver://127.0.0.1:1433;SelectMethod=cursor;User=<username>;Password=<password>;DatabaseName=ORABPEL">
    </data-source>
    after starting the BPEL PM Server, I got the following set of error messages:
    Loading processes for BPEL domain "default" ...
    <2005-06-02 09:36:44,482> <ERROR> <default.collaxa.cube.sensor> <PCException::<i
    nit>> Sensors not supported.
    <2005-06-02 09:36:44,482> <ERROR> <default.collaxa.cube.sensor> <PCException::<i
    nit>> Sensors are not supported on this database platform.
    <2005-06-02 09:36:44,482> <ERROR> <default.collaxa.cube.sensor> <PCException::<i
    nit>> If sensor functionality is required, please switch to a supported platform
    After this I went and changed the class tags to: com.microsoft.jdbcx.sqlserver.SQLServerDataSource
    restarted the server and got the following:
    <2005-06-02 09:22:52,531> <INFO> <collaxa> <ConnectionFactoryImpl::init> Initial
    ized connection factory jdbc/BPELServerDataSource
    05/06/02 09:23:06 ORABPEL-04077
    Cannot fetch a datasource connection.
    The process domain was unable to establish a connection with the datasource with
    the connection URL "loc/BPELServerDataSource". The exception reported is: Cann
    ot fetch a datasource connection.
    The process domain was unable to establish a connection with the datasource with
    the connection URL "loc/BPELServerDataSource". The exception reported is: [Mic
    rosoft][SQLServer 2000 Driver for JDBC]Unable to connect. DataSource property s
    erverName must be specified.
    Please check that the machine hosting the datasource is physically connected to
    the network. Otherwise, check that the datasource connection parameters (user/p
    assword) is currently valid.
    Please check that the machine hosting the datasource is physically connected to
    the network. Otherwise, check that the datasource connection parameters (user/p
    assword) is currently valid.

    Hi,
    I just saw your post message about configuring SQL server 2000 with Oracle BPLE. Have you configured it successfully or still encountered any problem.
    I am new to Oracle BPEL. Want to know if Oracle BPEL can use MSFT SQL server 2000 as the repository entirely, therefore, we don't need Oracle (or Oracle light database).
    Will really appreciate if you can share information and experience to configure SQL 2000 with Oracle BPEL.
    Thank you so much in advance.
    Leey

  • SQL Server nvarchar and JDBC

    Hi to all,
    My DBMS is SQL Server2000 and i created a table which has two columns. Two of them were defined as varchar, but when i wrote Turkish character, these characters automaticly were converted to the different characters. Because varchar does not support Unicode. So, I had to use nvarchar, but if i used nvarchar how can I match nvarchar values to the java.sql.Types. There is no matching values for SQL Server nvarchar type. So, that is my question, how can i write Turkish character to the SQL Server via application which uses JDBC API to connect to the SQL Server.
    Regards
    Bulent

    Hi I am curious to see how you established a JDBC connection using Java to SQL Server 2000.
    Can you provide some code as an example for me?
    I am having problems just establishing a connection. I downloaded the JDBC driver from MS site and installed it.
    Here is some code I got:
    Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://DEV01:1433;DatabaseName=NG_RFQ;SelectMethod=cursor", "jla", "jla");
                   Statement stmt = con.createStatement();
                   ResultSet rs = stmt.executeQuery("SELECT * FROM Customer");
                   if(rs.next()){
                        customerName = rs.getString("CustomerName");
                        buyerName = rs.getString("BuyerName");
                   con.close();
    Can you tell me what I am doing wrong? Do I need to create a new DSN or something? I have no idea.
    Please advise.
    Thanks!!!

  • SQL Server 2000 and problems conecting to DBase

    Hello, I get this code:
    String url = "jdbc:microsoft:sqlserver://localhost:1433";
        //jdbc:microsoft://server:port/database
        String user = "wilson";
        String password = "";But I get this stackTrace:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'wilson'. Reason: Not associated with a trusted SQL Server connection.
    But i did create this user.
    Besides, when I run the Query Analiser tool, if I try to log in to the DBase using this user, the same problem happens. When i choos Windows Autentication it works, what can I do?
    Thanks a lot

    Find the person who configured that SQL Server instance and explain to them that requiring Windows authentication is a problem for you.

  • SQL Server 2000 and accented characters

    Is there anyone else out there that has had the following problem? IO am using Microsoft's own JDBC driver for SQL Server 2000 to retrieve some information from one SQL Server 2000 database and deposit it in another. Both datbases use the same collation, namely Finnish_Swedish. However when the driver lifts Swedish characters, namely �, �, and � out of one database, it replaces them with strange characters. For example, the name SJ�BERG becomes SJ?BERG. The strange thing is that such transfers worked just fine with SQL Server 7. I would really appreciate some help with this, since my comapny is dealing with this issue in two client installations.
    Thanks!
    /Arthur Gaudio

    Ok, managed to find the solution myself. If anyone else has this problem, I would recommend downloading JDBC Driver Service Pack 1 for Microsoft SQL Server 2000. You can find it on Microsoft's home page :
    http://www.microsoft.com/downloads/details.aspx?FamilyID=4f8f2f01-1ed7-4c4d-8f7b-3d47969e66ae&DisplayLang=en
    One of the issues that has been fixed is that Latin collations were not being tranlated correctly to unicode, except for the Greek lanuage (?). Seems to have also been the case for Finnish_Swedish.
    /Arthur

  • Basic Deployment problem, SQL Server 2000 and wanna create setup

    I have just finished making a small app using Java and using JDBC driver to connect to an SQL Server 2000 that is installed on my PC.
    I now want to create a setup (using NSIS) of this app and distribute among friends. But my problem is that I have created the database on my PC on the SQL Server 2000. Do all the people who want to use my app have to have Sql Server 2000 installed ?? How do they get the data from the database if they dont have Sql Server installed??
    I really havent tried much of apps that use databases...soo dont know much, but then any help would be appreciated!!

    They have to connect to an instance of SQL Server 2000 that has the database and schema that your app requires, so the host machine has to be visible in their network, with SQL Server installed, listening on the port in your URL connection string (default is 1433), with a username and password that you've set up for a user with the appropriate permissions GRANTed.
    As you can see, it's not trivial.
    If all the people you're distributing the program to can see your machine's IP address, they can simply connect to your database.
    If not, you should provide all the scripts necessary to create the database and create the tables, set up the permissions, and populate the data.
    %

Maybe you are looking for

  • Multiple Languages in one Form

    Hello, I have a requirement to replace a preprinted form and create a form in SAP that contains  texts in multiple languages. e.g. Russian, Greek, Bulgarian, German, English etc. The  form also contains single lines of text with multiple Languages. D

  • Authorization error in web analysis

    Hi All, i have report level security in web analysis. but when the user tries to open the report with it does not have access it does not open it but when the user logs off it gives some Java error. early reply would be appreciated. thanks.

  • ACS SE 4.2, 802.1x and certificates for machine authentication

    I'm trying to figure out how to put this lot together, but dont know enough about ACS when used with an external CA. What I want to get working is: A PC with a machine cert gets connected to a switch running 802.1x. The switch uses EAP with .1x to qu

  • Frame names not listed

    I'm new to DW CS3. I'm using a frameset structure but the frame names do not list in the target field of the properties panel (shows "_blank, _parent" etc. defaults only but no created frames). Frame names are also missing from the "GoTo URL" list of

  • Help with transferring files from mac to (not my own) HDD; meaning format then copy is impossible

    I need to transfer files and folders from my macbook air to my boss's external HDD but I keep getting error messages. Anyone out there, please help me. Most of the answers here kept saying erase data then copy; not possible for me because this HDD is