Database Link to MSSQL using JDBC

Hi, i'm trying to create a database link from Oracle on Solaris to a MSSQL database. We don't have ODBC installed on the server so i'm hoping to use JDBC to connect. Is that possible? Can someone tell me the format to use for the connection string. Thanks...

It is not possible to create a database link using JDBC.
You could load the SQL Server Type 4 JDBC driver into the Oracle JVM and then write a Java stored procedure that accesses the remote database if you would like. But Heterogeneous Services with Generic Connectivity, which allows you to create database links to non-Oracle databases, only supports ODBC and OLE DB.
Justin

Similar Messages

  • Database-Link to MSSQL-Problem

    Hello,
    I created a database-link to MSSQL using Transparent Gateways!
    When I try a select on a table with over 200 datasets I get the ORA-errors:
    ORA-01002: FETCH....(closed CORSOR) and
    ORA-02063: Preceding line from VIDEOTHEK (which is my databaselink)
    How comes?
    Would You give me a hint?
    Best regards
    MArlon

    Ora-1002 normally occures while using a cursor that fetches the records from a remote database and having a commit somewhere in the code. The commit will close all open cursors to the foreign database and you need to open it again in case you want to use the cursor again.

  • How can you SELECT via Database Link CLOB data using Application Express?

    Customer Issue:
    Developer using Oracle's Application Express 3.1. The Developer is trying to SELECT a CLOB datatype column from a remote (10.2.0.3) database, via a database link on her 10.2.0.4 based client Application. The Developer wants to be able to select CLOB data from the remote database which has limitation that she can't make any changes to the remote database.
    Developer's Comments:
    I do a select and get the error. Getting error ORA-22992: cannot use LOB locators selected from remote tables. So she feels she can't use dbms_lob.substr in this configuration I can do a "select into" but that is for one value. I am trying to run a select statement for a report that brings back more than one row. I do not have permission to change anything on the remote database. I want to access the remote database and multiple tables.
    This is not something I work with, would greatly appreciate help or ideas. Is this a limitation of the 3.1; or does she just not have this set up correctly; or should she be using a Collection (if yes, please share example)
    Thanks very much,
    Pam
    Edited by: pmoutrie on Jun 4, 2009 12:01 PM
    Hello???
    Would really appreciate an answer.
    Thanks,
    Pam

    This may not be a perfect solution for you but it worked for my situation.
    I wanted to grab some data from Grid Control's MGMT$JOB_STEP_HISTORY table but I couldnt' create an Interactive Report due to the existance of a CLOB column. I cheated this by creating a view on the GC DB, grabbing the first 4000 characters and turning it into a varchar2 column:
    create view test_job_step_history as
    select job_Name, target_name, status, start_time, end_time, to_char(substr(output,1,4000)) output
    from MGMT$JOB_STEP_HISTORY where trunc(end_time) > trunc(sysdate)-90
    In an APEX Interactive Report:
    select * from test_job_step_history@GCDB
    Granted, the output looks aweful right now but I am only looking for a very particular output (failed, denied, ORA-, RMAN-, etc) so the formatting isn't the most important thing to me right now.
    If anyone can improve -- and I'm sure you can -- on this I'd love to hear about it.
    Thanks,
    Rich

  • Export Database Link & Public Synonyms using Expdp

    Dear All,
    We are using expdp to do schema level exports:
    expdp dumpfile=<Directory>:expdp.dmp SCHEMAS=S1,S2,S3
    We also want to export the Public/Private Synonyms (created for the objects owned by above users), Public/Private Database Links as part of above command.
    How we can achieve this? We are using 11gR2.
    regards,
    Riaz

    HI,
    Public synonym can not be exported and never exported even at FULL Export also. . You can get them from "dba_synonyms". I suggest that you create so customer script .
    select      'create public synonym ' || table_name || ' for ' || table_owner || '.' || table_name || ';'
    from      dba_synonyms
    where
         owner='PUBLIC' and table_owner not in ('SYS', 'SYSTEM')
    order by
         table_owner;
    More: Information:
    https://forums.oracle.com/thread/855639?start=0&tstart=0
    Oracle Data Pump Schema Export and Public Synonyms
    Thank you

  • Useing  a Idoc  an  Oracle  database Can be update useing JDBC Adapter

    Hi Guys,
    Can you help me on the above topic..
    Regd's
    Raj

    Hi Raj,
    You can use the Idoc Adapter on the sender side and JDBC on the reciever side. After you have configured your scenario, you should be able to write data into the oracle database.
    For the strucutre of your Datatype for insertion , just check this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    To access any Database from XI, you will have to install the corresponding Driver on your XI server.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10
    Or on the JDBC end you can write a stored procedure to make your data update more efficient.
    Go through this blog for stored procedures.
    /people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
    I hope this helps.
    Regards,
    Abhy

  • Can't connect to MSSQL using jdbc type 4

    My settings in the server are the followings:
    Data source class name : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Resource Type: javax.sql.DataSource
    And in the properties, i have added
    DatabaseName: jdbc:microsoft:sqlserver://SQL_SERVER:1433;DatabaseName=Borrar
    Because i have downloaded the jdbc driver type 4 sp3 from microsoft site, in the AppSrv-->JVM Settings --> Path Settings -->Classpath Suffix I have the following:
    C:/Sun/AppServer/pointbase/lib/pbclient.jar
    C:/Sun/AppServer/pointbase/lib/pbembedded.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/msbase.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/msutil.jar
    C:/Sun/AppServer/domains/domain1/lib/classes/mssqlserver.jar
    Using this configuration, when i press the button "Ping" when i'm configurating the connection pool, i have this message:
    " An error has occurred.
    Operation 'pingConnectionPool' failed in 'resources' Config Mbean. "
    Anyone can help me ??

    Since nobody posted the solution and I happened to found one, I want to contribute with the following information. Hope this helps:
    In order to create a connection pool for MSSQLServer
    you have to:
    1. Copy these files to the lib carpet inside domains/domain/DOMAIN_NAME/:
    mssqlserver.jar,
    msutil.jar,
    msbase.jar.
    You can find them in www.microsoft as a single package. Just look for JDBC Driver.
    2. In the administrator console of the AppServer, go to:
    Application Server -> JVM Settings -> Path Settings -> Classpath Suffix -> , and right there add the path for the previous files.
    Press 'Save' and restart the server.
    3. Go to JDBC -> Connection Pools -> New...
    Resource Type: javax.sql.DataSource'
    Database vendor: (none) (Dont select anything here).
    Press Next.
    4. In the field for Datasource ClassName, add
    com.microsoft.jdbcx.sqlserver.SQLServerDataSource
    (Here is where I`ve been having problems. I used to put com.microsoft.sqlserver.SQLServerDriver).
    5. The way to find out that the server found de library is through the attributes. You have to see exactly, among others:
    DatabaseName, SelectMethod, Password, User, PortNumber,ServerName.
    If you see: Port. It means the path to the library is wrong.
    6. Inform exactly the previous fields:
    DatabaseName= yourDBName
    SelectMethod=cursor
    Password=yourDBPassword
    User=yourDBUser
    PortNumber=1433
    ServerName=yourServerName
    7. That�s it. Press finish. and then select the connection you just created and hit ping. You shouldnt see the annoying message about some "MBEAN bla bla bla".
    Good luck. Greetings from Costa Rica.

  • Connecting to a database through the Proxy using JDBC

    Hi,
    I am working on core java.
    I want to established connection to remote database(I am working on local network behind the proxy)
    how can i do this using core java
    thanks in advance
    regards
    Man479

    The only issue I see here is configuring the proxy to allow the client program to connect to a certain port on the server. And that issue would normally be dealt with by asking the person who manages the proxy to set it up that way.

  • Using database link in my triggers,urgent

    There's DB A on ServerA,DB B on ServerB.Table TA in ServerA's DB and TB on ServerB's DB.My purpose is to synchronize usera.TA with userb.TB real time.
    In order to realize it,I created dblink AtoB from A to B using command "create database link AtoB.domain connect to userb identified by userb using 'BTNSname';",it's no problem for I have test on it :select count(*) from [email protected];It's ok to get the result.
    But when I create trigger on table TA by using the dblink AtoB.domain to update,delete and insert datas to TB,the error "PLS-00201: identifier '[email protected]' must be declared" occurs while compiling.
    The oracle version on the two servers is 8.1.7.
    It happens on the production envrionment,but in our lab,there's no problem.The difference between them is that it is cluster structure in production one.
    I tried several times,but failed,just wondered if some privilege was not right?But I can do selection from this dblink,only in trigger there's compilation errors.
    Really hope that someone could give light on it.
    Thank you in advance!
    In addition,I did some modification in my triggers to have a try.
    I created a synonym for the remote table,and the trigger then updates the synonym instead of the remote table [email protected] .But also failed.
    The same error,saying the synonym is not declared.
    Any good way to realize the same thing?

    Thank you for your answering first.
    I don't use replication because the destination table's structure is not exactly the same as the source one.
    --The selection was done in the production,connection to the source schema,then select through the dblink from the source to the dest schema,the trigger is created in source schema on source table to handle datas in destination schema's table.In lab,all is ok,no such a problem.
    --I created two dblinks,one is connect to source as system user,created a public dblink "create public database link AtoB.domain using 'BTNSname';";the other is connect as UserA,"create database link AtoB.domain connect to UserB identified by UserB using 'BTNSname';".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ORA-01017 error while using a database link

    Hi all,
    I have a TNS entry as below
    HOME=
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=10.66.205.110)(PORT=1521))
    (CONNECT_DATA=(SID=HOME))
    I have created a database link as
    create public database link link92.com using 'HOME'.
    This was created successfully and an entry was made in all_db_links table.
    However if i try connecting to a table in the remote database...for example
    select * from emp@link92;
    I am receiving an error ORA-01017(Invalid username passwd).
    Would appreciate if somebody could help me out.
    Thank you

    It is not that the Database Link is "PUBLIC" that makes it use the current username/password.
    It is that the Database Link has been created without specifying a " CONNECT TO username IDENTIFIED BY password " that makes the DBLink behave as a "current user database link" using the current username/password to connect to the remote database.
    You can have a PUBLIC database link that uses a "CONNECT TO username IDENTIFIED BY password" such that all connections use the same remote username and password.
    You can also have "private" (ie not PUBLIC) database link that does not specify a "CONNECT TO username IDENTIFIED BY password" which becomes a "current user [owner] database link".

  • Creating user using database link

    Hi
    I have 11g installed on one of the server
    I have created the database link BUGAU to bugau.us.oracle.com
    link works fine
    select * from table@"Bugau" gives the expected result
    I need run the below statement from my server using the dblink.but not sure how to use the dblink for this purpose.Please assit
    CREATE USER ABC IDENTIFIED BY welcome DEFAULT TABLESPACE USERS_001 TEMPORARY TABLESPACE temp123;
    GRANT DEFAULT TO abc;
    ALTER USER abc PROFILE LEVEL_1;
    Thanks
    Archana

    as mentioned in oracle documentation for db link purpose: you can use it for accessing schema objects in remote database..
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm
    >
    Use the CREATE DATABASE LINK statement to create a database link. A database link is a schema object in one database that enables you to access objects on another database. The other database need not be an Oracle Database system. However, to access non-Oracle systems you must use Oracle Heterogeneous Services.
    After you have created a database link, you can use it in SQL statements to refer to tables and views on the other database by appending @dblink to the table or view name. You can query a table or view on the other database with the SELECT statement. You can also access remote tables and views using any INSERT, UPDATE, DELETE, or LOCK TABLE statement.
    >
    For creating users, you have to login to the remote database itself, You also need to login using the user who has the necessary credentials to create the user.
    Regards,
    Dipali.

  • Performance issue about using JDBC?

    Since no one reply me, I post again. :(
    I just got a big performance problem lately, and I tried all the possible ways, still can't fix it. Could you help me out or give me more suggestions?
    Oracle 8i for Solaris 2.6
    A web application with back end is Oracle database, developed by Java, use JDBC driver. It also uses Servelet. Report generated in browser is using dynamic SQL.
    When I click some link to generate report in browser, it will run the corresponding SQL script, then return the result to browser. The problem is it takes long long time to get the result. For simple query, it takes around 2-3 minutes. But if I run the same SQL script in
    SQL*Plus, it only takes 4-5 seconds, or even less. So I think the index for this query is fine. (I also rebuild all indices, some result.) And all the hit ratios in SGA are also OK. When browser generate reports, I didn't see high CPU usage or I/O activity.
    I really have no idea why this happens. But I think the Oracle DB is fine, 'cause query is run normally in SQL*Plus. The problem may related to the JDBC driver or JDBC connection. The developers also have no clue about this. When the Java app run the query, does it use the same way to access the tables and indexes as used in SQL*Plus?
    Any idea or suggestions?
    Thanks a lot and have a good day!
    null

    Thanks for all.
    So do you guys has any suggestion on the following code?
    DESCRIBE TABLE gt_vbeln LINES l_lines.
      IF l_lines = 0.
    ***>>Links20060411
    *  ELSEIF l_lines GT c_1000.
    *    SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
    *        APPENDING TABLE gt_vbfa_all PACKAGE SIZE c_1000
    *        FROM vbfa
    *        FOR   ALL ENTRIES IN gt_vbeln
    *        WHERE vbelv   EQ  gt_vbeln-vbelv
    *          AND posnv   EQ gt_vbeln-posnv
    *          AND vbtyp_n IN ('T', 'J', 'R', 'h').
    *    ENDSELECT.
    *  ELSE.
    *    SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
    *        INTO TABLE gt_vbfa_all FROM vbfa
    *        FOR   ALL ENTRIES IN gt_vbeln
    *        WHERE vbelv   EQ  gt_vbeln-vbelv
    *          AND posnv   EQ  gt_vbeln-posnv
    *          AND vbtyp_n IN ('T', 'J', 'R', 'h').
      ELSEIF l_lines > c_1000.
        SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
            APPENDING TABLE gt_vbfa PACKAGE SIZE c_1000
            FROM vbfa
            FOR   ALL ENTRIES IN gt_vbeln
            WHERE vbelv   =  gt_vbeln-vbelv
              AND posnv   = gt_vbeln-posnv
              AND vbtyp_n IN ('T', 'J').
        ENDSELECT.
      ELSE.
        SELECT vbelv posnv vbeln posnn vbtyp_n rfmng
            INTO TABLE gt_vbfa FROM vbfa
            FOR   ALL ENTRIES IN gt_vbeln
            WHERE vbelv   =  gt_vbeln-vbelv
              AND posnv   =  gt_vbeln-posnv
              AND vbtyp_n IN ('T', 'J').
      ENDIF.
    Currently it runs timeout ,as the l_lines is very very large.
    I think maybe we  can change the package size. But what's the best package size for performance?
    Thanks..

  • Problem using Jdbc-Odbc Bridge

    Hi,
    I am using Java 2 SDK and I am trying to access MS Access database on my machine using Jdbc-Odbc bridge. I have set up the DSN in ODBC. But I get the following error when I run my program -
    'No Suitable Driver'
    Here's my code snippet-
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    String dsn = "jdbc:odbc:DriverInfoDB";
    Connection con = DriverManager.getConnection(dsn,"","");
    con.setAutoCommit(false);
    Statement stmt;
    String query = null; // SQL select string
    ResultSet rs; // SQL query results
    stmt = con.createStatement();
    .....etc etc...
    Where is the error in this code??
    Help Needed!!
    Thanks
    Vivek.

    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection(dsn,"guest","guest");
    OR DriverManager.getConnection(dsn);
    System.out.println("Conection's opened");
    catch(ClassNotFoundException cnfe)
    System.err.println(cnfe);
    catch(SQLException sqle)
    System.err.println(sqle);
    try that code and double check you DSN Name . it's a good practice to greate a system DSN.
    i hope that helps.
    FEEL FREE TO ASK. WON'T BITE U
    ABDUL

  • Database links issue ORA-01017 ORA-02063

    Oracle 11g R1 , RHEL 5 64bit
    HI all,
    I am having this strange issue with my database links. They used to work in the past but now they are not. Here is what I have checked:
    - All the TNSnames.ora file entries are there and are correct...I double checked with tnsping
    - I changed all the passwords to be the same on all environments (DEV/QA/PROD)
    - I have dropped and re-created all the database links
    However, I still get the same error when I test them:
    ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from <database_name>
    Here are the links created on DEV:
    SQL> select * from dba_db_links;
    OWNER DB_LINK USERNAME HOST CREATED
    PUBLIC FPRCQA.FPRC.OPHTH.WISC.EDU FPRCQA 01282009
    FPRCHR FPRCQA.FPRC.OPHTH.WISC.EDU FPRCHR FPRCQA 01282009
    PUBLIC FPRCPROD.FPRC.OPHTH.WISC.EDU FPRCPROD 01282009
    FPRCHR FPRCPROD.FPRC.OPHTH.WISC.EDU FPRCHR FPRCPROD 01282009
    The above links were created using the following syntax:
    SQL> conn sys as sysdba
    Enter password:
    Connected.
    SQL> create public database link FPRCQA.FPRC.OPHTH.WISC.EDU using 'FPRCQA';
    Database link created.
    SQL> create public database link FPRCPROD.FPRC.OPHTH.WISC.EDU using 'FPRCPROD';
    Database link created.
    SQL> conn fprchr
    Enter password:
    Connected.
    SQL> CREATE DATABASE LINK FPRCQA.FPRC.OPHTH.WISC.EDU CONNECT TO FPRCHR IDENTIFIED by <passwd> using 'FPRCQA';
    Database link created.
    SQL> CREATE DATABASE LINK FPRCPROD.FPRC.OPHTH.WISC.EDU CONNECT TO FPRCHR IDENTIFIED by <passwd> using 'FPRCPROD';
    Database link created.
    Now when I do a simple query, I get the error:
    SQL> select count(*) from fprchr.department@FPRCQA;
    select count(*) from fprchr.department@FPRCQA
    ERROR at line 1:
    ORA-01017: invalid username/password; logon denied
    ORA-02063: preceding line from FPRCQA
    I have read some notes on metalink, but they were talking about situations where you have a 10g database connecting to an 11g database and the whole password case-sensitivity issue, but this is not the case here as all the databases are 11g.
    I would appreciate any and all help on this issue.
    Thank you much.

    The documentation has the answer:
    user IDENTIFIED BY passwordSpecify the username and password used to connect to the remote database using a fixed user database link. If you omit this clause, the database link uses the username and password of each user who is connected to the database. This is called a connected user database link.>
    Since you haven't specified user/password in your public database links, then Oracle will try to create a connection on the remote db with the same user/password who is trying to use the database link. If the user doesn't exists or has a different password then you get an error (the same you mentioned in you original post)
    HTH
    Enrique

  • Global_name and database link

    I have Windows XP with 10.2.0.1.0
    I have made my database global_name to be junk.points.com.
    And, I create a database link as:
    create database link preview using 'xxxxx';
    the db_link is preview.point.com.
    However, if I use the following command:
    create database link preview.system using 'xxxxx';
    the db_link is preview.system instead of preview.system.points.com.
    I expect the db_link should be preview.system.points.com. Please help.
    Thanks

    Hi,
    Specify the complete or partial name of the database link. If you specify only the database name, then Oracle Database implicitly appends the database domain of the local database.
    If the value of the GLOBAL_NAMES initialization parameter is TRUE, then the database link must have the same name as the database to which it connects. If the value of GLOBAL_NAMES is FALSE, and if you have changed the global name of the database, then you can specify the global name.
    Defining a CURRENT_USER Database Link: Example
    The following statement defines a current-user database link to the remote database, using the entire service name as the link name:
    CREATE DATABASE LINK remote.us.oracle.com
    CONNECT TO CURRENT_USER
    USING 'remote';
    The user who issues this statement must be a global user registered with the LDAP directory service.
    Please view the below document.
    http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_5005.htm
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/ds_admin002.htm
    And please check the db links you posted one is having __.point.com
    and the other one is having ___.points.com
    Please make sure you are using the GLOBAL_NAMES set true and displaying correct dblink .
    Hope this will be helpful :)
    Thanks,
    Balaji K.

  • Connecting to Oracle 7.3.3.4 using JDBC

    Hi all,
    I found the below info in the Oracle JDBC FAQ. My questions are:
    1. Is there any chance for me to connect to my 7.3.3.4 database server using any JDBC drivers? If yes, what version of drivers to use?
    2. Is it true that to connect to an Oracle database, I can ONLY use JDBC drivers from Oracle and no where else?
    Thanks!
    Rgds,
    Alvin
    JDBC 7.3.4 drivers can talk to RDBMS 7.3.4.
    JDBC 8.0.4 drivers can talk to RDBMS 8.0.4 and 7.3.4.
    JDBC 8.0.5 drivers can talk to RDBMS 8.0.5, 8.0.4 and 7.3.4.
    JDBC 8.0.6 drivers can talk to RDBMS 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
    JDBC 8.1.5 drivers can talk to RDBMS 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
    JDBC 8.1.6sdk drivers can talk to RDBMS 8.1.6sdk, 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.
    JDBC 8.1.6 drivers can talk to RDBMS 8.1.6, 8.1.6sdk, 8.1.5, 8.0.6, 8.0.5, 8.0.4 and 7.3.4.

    I used the following code to call a stored
    procedure via SQLJ:
    try {
    #sql [iCtx] {
    CALL ibs.cvs_validate.validate_port_id(:IN record_id ,:IN poe_pod_flag,:IN port_id,:OUT error_code,:OUT error_message) };
    where
    "ibs" is the schema
    "cvs_validate" is the package
    "validate_port_id" is the procedure
    The code runs fine, but to get it to compile
    in JDeveloper 2.0, I had to disable the "Check SQL semantics against database schema" option on the Project Properties (SQLJ) property sheet.
    null

Maybe you are looking for

  • How do I get spry drop down menus to display infront of my content?

    Hi, I am currently using DW CS4 to create a website for a uni project. I have created a Spry Menu bar which displays correctly when I preview it however I have uploaded a few pages to my site to test them and the drop down menus disappear behind my c

  • How to populate a listbox with key in a table control

    I have the following code: MODULE carga_huecos INPUT. DATA: BEGIN OF li_huecos OCCURS 0,         key(40) TYPE c,         text(80) TYPE c, END OF li_huecos. DATA: BEGIN OF estru_hueco OCCURS 0,       hueco LIKE zmov_wm-hueco, END OF estru_hueco. CLEAR

  • Projects data by GL segments

    Hi All, 1. We got a requirement to pull the project expenditure cost, revenue, budget & forecast data from Oracle, w.r.t gl code combination wise. As expenditures and revenues are posted to GL, (also based on cost distribution lines and pa events tab

  • Time constraint class for Time infotype

    Hi all, Where is the table to create a new time constraint class? I know how to link the reaction rules, but not how to create a new digit? Thanks

  • 100% cpu utilisation SQL Dev 1.5 on XP

    Using SQL Dev 1.5 prod version on XP on a P4 3ghz with 2gb of ram, SQL Dev executable regularly uses 100% cpu utilisation as reported by task manager. Also frequently stops responding - no screen redraw and I have to end task. Until recently I only h