How to connect to a Remote Oracle Database

Hi Friends,
The error I encountered while connecting to a remote database is ���DataSource name is too long
String url="jdbc:odbc://abc:1523/test";
con = DriverManager.getConnection(url,"xyz","xyz1");
Here Remote Host-name = abc
Port = 1523
DataSource Name=test
User-name = xyz
Password =xyz1
The DataSource is created Using Oracle ODBC driver on Windows 2000
With following details
DataSource name=test
Service name = xyz (Database Name)
User-id=xyz (User name)
Thanks in advance
Hamsa

As suggested you should use a oracle jdbc driver type 2 (JDBC OCI Driver) or 4 (JDBC Thin Driver).
Because the thin driver is written entirely in Java, is platform-independent. It does not require any
additional Oracle software on the client side. It can be used for Oracle JDBC applets or applications.
The OCI driver is targeted for client-server Java applications. It requires an Oracle client installation, so it is Oracle platform-specific and it is not suitable for applets.
To connect to a database using those drivers here you have two examples of establishing a connection:
For OCI driver:
Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@<dbName>","user","password");
For thin driver:
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@<host>:<port>:<dbName>", "user", "password");
And make sure that the classes12.zip file is included in your CLASSPATH.

Similar Messages

  • Using Oracle ODBC Gateway connecting to a remote Oracle database

    Oracle 11gR2
    RHEL 6.4
    Has anyone use the Oracle ODBC Gateway to connect to another Oracle database?  Any issues with that configuration?  Where do I get the ODBC drivers for Linux?
    (I know, "why not use a dblink?" -- well that would be against company security policies)

    Hi,
       From the Oracle point of view we support using DG4ODBC for Oracle to Oracle connections. However, we have not actually tested it as DG4ODBC is primarily designed for access to non-Oracle databases.
    How DG4ODBC will work between Oracle databases depends on the ODBC driver and what that supports. You will need an ODBC Oracle driver which you can get from various suppliers including Oracle but also vendors such as DataDirect, Easysoft etc. You could try a Google search.
    You say you do not want to use database links but that is how DG4ODBC is used, You cannot do -
    sqlplus user/password@dg4odbc_oracle
    Once Dg4ODBC is setup and configured as in this note - if you are using Linux 64-bit -
    How to Configure DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX Itanium) to Connect to Non-Oracle Databases Post Install (Doc ID 561033.1)
    then in the Oracle database you create a database link and select from tables in the other Oracle database -
    select * from table@dg4odbc_db_link ;
    Regards,
    Mike

  • How to connect more than one oracle databases in single form?

    Hi,
    I have installed Oracle database in three different servers with different users, but the table's structure are same in all three different database users.
    Now in one D2K form i want to connect and access, all three different database users at a time.
    If anybody know answer for this please replay.
    My mail Id: [email protected]
    Regards
    Mahaveer

    You can access other databases/schemas by means of the built-in-package EXEC_SQL. See online help in Forms Builder, especially EXEC_SQL.Open_Connection, EXEC_SQL.Open_Cursor, EXEC_SQL.Fetch_Rows, ...
    If you want to base your blocks on several database connections at the same time, you should write your own on-select, on-fetch, on-lock, ... triggers, I suppose.
    Marc

  • How to setup my c# command line application to a remote oracle database?

    Hi all,
    I will like to ask, how do I setup my C# program to be able to connect to a remote oracle database?
    More information:
    - I have an oracle database express version running on my PC.
    - I am able to run and get data from the database on the same PC.
    - But when I bring my application over to another PC within the same LAN. It does not run and given me an error stating "The provider is not compatible with the version of Oracle client".
    What do I need to do on the Client PC so that I am able to communicate back to the server database?
    Many thanks!

    This is the XE forum, not the .NET programming forum, but this might be helpful:
    http://www.codeproject.com/Articles/18692/Instant-Oracle-Using-C

  • Not able to connect remote oracle database over VPN

    I can not connect remote oracle database over VPN. tnsping is ok and it shows the server information of remote database. i can also telnet the 1521 port of remote database server. I can connect the same server when it is located in the same LAN. Please help me out this is very urgent.

    6b6c669e-6baa-45c4-a6dc-444aef2d5e7a wrote:
    I can not connect remote oracle database over VPN. tnsping is ok and it shows the server information of remote database. i can also telnet the 1521 port of remote database server. I can connect the same server when it is located in the same LAN. Please help me out this is very urgent.
    First, this is a forum of volunteers.  There is no "urgent" here.
    "Urgent" means one of two things -
    1) people are dying, or
    2) you have a customer-facing, revenue-producing production system that is down.
    (And to get some perspective on the second case, keep the first in mind.)
    For the first, you call whatever civil emergency service seems appropriate.
    For the second, you open an SR with Oracle - which requires a paid-up support contract. For *them* to consider your problem "urgent", you will need to demonstrate that your problem falls under item #2. I seriously doubt your problem fits that criteria.
    You don't have a support contract?  Now you know the exact dollar figure that your company places on the data.
    That said, you need to understand a few things about your specific problem,
    First, port 1521 is only used by the listener to accept a connection request.  Once it gets that request (and finds that it is for a service (sid) that it knows about, it will fork a server process and tell the requesting client that it can communicate with that server process over some other port .. a randomly chosen port number in the "high" range.  It could be your vpn is blocking that other port, whereas your internal firewall is not.
    But this is just an educated guess since I cannot find "can not connect remote oracle database over VPN" in any error message manual. If you had mentioned the VPN along with an actual oracle error message we could be much more precise in our diagnoses and recommendations.
    ---- edit 22 Sep
    It occurred to me that I just assumed you were using the same client machine in both cases ... a laptop that you use both at work (local network) and home (vpn).  If that assumption is false, there are probably problems with your tns setup on the home (vpn) machine.
    But again, it would be much easier to help if you gave us an actual error message.

  • How to connect to a remote database in a lan??

    Hey guys......! I need to connect to a remote msaccess database in a lan and import its data into my mysql database.I know how to connect to a msaccess database using ODBC.But I don't know how to connect to a remote database without creating dsn in the machine where database is.One thing more...I want to know, how can I import data into my mysql database?? Is there any query for that or simply I have to select data from msaccess database and insert into tables of my database??Please, send me the source code in the forum itself and explain also.This is the last feature of my project.So I need to do it as soon as possible.

    If the mdb file in LAN, Just map the network drive.[Windows Explorer/Tools/Map Network Drive] in your system from which we need to access the remote mdb. Then go to ODBC Data Source Admin.. and create a new data source[Microsoft Access Driver] . After clicking the Select button, you will find a Network Drive will be visible on your Drives drop down. Select the map Drive, If not visible then just click the Network button there and map the network path where the mdb files reside. And use the JdbdOdbcDriver class to connect from java.

  • Connect to Remote Oracle Database

    I am unsuccessfully trying to connect to remote Oracle database using OleDB/ODBC/Oracle Client.
    Do I have to install Oracle Client in order to use those drivers and which version?
    I would really appreciate any help. THANK YOU!

    Marina,
    Please refer this question to the general Installation forum. Thanks!
    The short answer is yes, you need to have the Oracle client software installed.

  • Oracle raise ORA-03113 when connect to a remote oracle server using toad

    Hi there,
    when i use the tool toad connect to a remote oracle server which located in a different city,
    when i submit a query in toad,
    if the query returns many rows of data, it will raise the error ORA-03113:end-of-file on communication channel,
    however if the query returns only a few rows, i won't raise such error,
    however, when i use sqlplus connect to that remote server, it won't raise such error,
    what's the reason is, can any one tell me how to tackle this problem if using the tool toad. thanks/

    hi my oracle vsersion is:
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    my oracle server is 2 nodes rac server,
    and i've tried two different kind version of toad v9.6 and v10.5, and both have the same problem
    once i query a table, if the result returned more than 30 rows, then it will raise that error, if query returns less than 30 rows, it's ok.
    i assume it is a problem concern with network, but i don't know why no such error raise when using sqlplus ?

  • DBA Cockpit: Planning calendar and remote Oracle databases- which method?

    For using DBA Planning Calendar to schedule BR*Tools for remote Oracle database AS Java systems I have successfully implemented both the Secure Shell and SAP gateway methods in [Note 1025707 - DBA Cockpit: Planning calendar and remote Oracle databases|https://service.sap.com/sap/support/notes/1025707] and was interested in which of these two methods others have found to be more supportable and maintainable?
    In more detail, the note has these two methods for non-ABAP remote systems:
    2. Connection through Remote/Secure Shell
    Specifically Secure Shell. Rejecting remote shell as too old and insecure a protocol.
    3 Connection through SAP gateway
    The note provides clues as to how these methods work. Expanding on that:
    With #2, central ABAP system calls out to its OS user level to execute the ssh client (after gw/rem_start has been set to the non-default value SSH_SHELL) which it finds in the location specified in gw/ssh (default value is /usr/bin/ssh). It must use password-less authentication and the key-based authentication must also not require a passphrase. (Using ssh-agent is not an option since this is being called from SAP, not from your own script.)
    It remotely runs via ssh a command, sapxpg, which must be found in the PATH of the remote user. (This is why the note, which has you place this exe sapxpg and a subset of the BR*Tools in the home dir of the remote user, also has you make sure the home dir is included in the path--your OS might or might not include the user's home dir in the path in the default shell environment for a new user.)
    Then via sapxpg, the BR*Tools are invoked.
    One thing that may be confusing here is you have to check at least one gateway parameter 'gw/...' in the central system to get the method #2 the non-gateway method to work--this is because the two methods are technically almost the same: in #2, secure shell is used to basically start a gateway on the fly with sapxpg in order to call the BR*Tools each time a DBA Planning Calendar action runs or you view DBA or Backup logs of the remote system from the central system. With #3, the gateway runs continuously on the remote system.
    With #3, central system connects to remote SAP standalone gateway, which executes the BR*Tools installed in the standard SAP kernel directory of the SAP gateway. This method is simpler to describe so it sounds like it has less components than the secure shell method, however you do have an entire SAP system running, although it is just a standalone gateway.
    Thoughts:
    These pros/cons are UNIX/Linux-oriented since I assume most Windows environments do not have added 3rd-party products that provide secure shell so SAP gateway is the only method.
    Secure shell
    + Less software required (not counting secure shell which comes with the operating system distribution): just a few SAP executables placed in the home dir of an ordinary user on the remote system.
    + Secure shell service probably automatically starts upon boot of the remote system operating system.
    + Secure shell is a widely used tool outside of SAP for executing commands remotely without passwords.
    - Installation is non-standard: shell environment of remote user is not adapted by SAP installer since SAP installer is not used, SAP executables in the home dir of the remote user is non-standard. Has to be setup manually.
    - Requires setting up secure shell key-based authentication, which should be known by UNIX/Linux admins or combined Basis/UNIX/Linux admins, but might be less familiar to SAP Web AS only admins.
    - If your admin config policy is to have SAP interact as little possible with the OS level for interfaces with other systems, here you are relying on the OS-level secure shell.
    - Using a private key that does not require a passphrase on the central system may not fit with your security policies if you have standards for secure shell configuration.
    SAP gateway
    + The gateway is a standard installation, performed with SAP installation tool, with the exception of a few additional environment settings that have to be added after the installation. BR*Tools are installed in the standard location. Can use standard procedures for updating this software.
    + Only uses SAP software.
    - More software on remote system: standalone gateway just to run BR*Tools and view logs.
    - SAP Kernel of remote gateway should probably be updated whenever you do SAP kernel updates across your systems for consistency. One more system to update.
    - Shell environment of remote user that runs the gateway looks like something setup by the SAP installer but is not standard because it has a few additional environment variables added.
    - Need to make sure the SAP gateway is started on the remote system.

    Hi Joe,
    I configured a monitoring/dba landscape for two SAP Portals and one SAP BusinessObjects system on a SAP landscape by using DBACOCKPIT, at a customer site. These systems are running on AIX, Windows 2003/2008 servers and attached to the central monitoring system with standalone SAP gateway installations.
    One another reason to not use OS based commands or 3rd party tools is security. We are stopping and disabling most of the services on OS where SAP system is running on, because of the security reasons. I faced more security gaps on rsh/ssh and the other tools than standalone SAP Gateway installations. As you can figure out that rsh/ssh is getting more attack than standalone SAP Gateway, because of well known by the IT world.
    As a summary of it, this depends to point of view and policy of the IT organization. I applied both ssh and standalone SAP Gateway solutions at my customers, but I choose standalone SAP Gateway installation among of them.
    Best regards,
    Orkun Gedik

  • How to I convert data from oracle database into excel sheet

    how to I convert data from oracle database into excel sheet.
    I need to import columns and there datas from oracle database to microsoft excel sheet.
    Please let me know the different ways for doing this.
    Thanks.

    asktom.oracle.com has an excellent article on writing a PL/SQL procedure that dumps data to an Excel spreadsheet-- search for 'Excel' and it'll come up.
    You can also use your favorite connection protocol (ODBC, OLE DB, etc) to connect from Excel to Oracle and pull the data out that way.
    Justin

  • Connecting form 6i  to oracle database 10G express edition

    I am unable to connect forms 6i to oracle database 10G express edition.
    form builder closes without any message.

    Hi, i was try that solution, but have some problem.
    1) I have stopped other database (Oracle 8i, OracleService + Listener), none Oracle service was running.
    2) I was install Oracle XE Univ.
    3) Run sqlplus from XE
    "D:\oraclexe\app\oracle\product\10.2.0\server\BIN>sqlplus system/PASSWORD@xe as sysdba"
    4) Shutdown immediate - OK
    5) Startup mount - failed
    SQL> startup mount
    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    6) I was check registry "hkey_local_machine\software\oracle" and delete key "local" (walue was set to connection to 8i database).
    7) I was checking status of Listener from XE (after shutdown).
    "Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jacek)(PORT=1521)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully"
    Have anyone suggestion how to connect "directly" to XE (without @CONNECTION string) ?
    If source of problem can be having DB 8i installed on same machine ?
    BBye.

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to connect captivate file in a database (MS SQL SERVER 2008)

    Hi...
    How to connect captivate file in a database (MS SQL SERVER 2008) ???
    Kindly response please..
    thanks!!!

    Hi there
    See if the link below helps you out.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • How to connect google maps with oracle

    Hello people ,
    i read an artical there is a way to connect google maps with oracle .
    can anyone give us lesson or more information to do that ?
    regards .

    I guess, using Google for the same should be the best way to find the solution for it,
    http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=How+to+connect+google+maps+with+oracle
    HTH
    Aman....

  • Connecting to a non-oracle database (jdbc) from a java stored procedure

    Does anyone know to configure the database to allow a connection to a non-oracle database from a Java Stored procedured, using JDBC?
    Thank you in advance,
    Chris

    Hi Chris,
    I haven't tried it, and these are just some of my thoughts, but I
    think you would need to load the JDBC driver for the other database
    into the Oracle database (using the "loadjava" tool, of-course).
    Then your java stored procedure should be able to instantiate the
    third party JDBC driver and obtain a connection to the other database.
    Hope this helps.
    Good Luck,
    Avi.

Maybe you are looking for