Does ODBC SQLDriverConnect allow connections without using tnsnames.ora?

I am trying to find out if the Oracle ODBC driver supports a connection attempt through the SQLDriverConnect() ODBC API function without the need to use the tnsnames.ora file. In other words, I would like to pass into the SQLDriverConnect() function the connection string information that would normally be found in the tnsnames.ora file. The purpose of this would be to force the ODBC driver to bypass reading the tnsnames.ora file entirely and simply use the connection information I pass into the connection buffer in the SQLDriverConnect() function.
If this is possible, can someone explain how to do it? I've tried what I think should have worked, so I'm either not doing this right or this functionallity is not supported by the driver.
Thank you.
-Dave

You might try logging a support request to see if that functionality got restored at some point. My recollection is a year or two old...
The Easy Connect syntax is just another feature of the TNS layer, so it should be available to any apps using the 10g client.
The documentation discusses using the Easy Connect Naming Method in some detail. I've not used it with the Oracle ODBC driver, but it should just work.
Justin

Similar Messages

  • How to use ODBC SQLDriverConnect() without using tnsnames.ora file

    I have an ODBC application that connects to an Oracle 10g database. Currently, my SQLDriverConnect() function call uses the following connection string:
    DRIVER={Oracle in OraClient10g_home1}; DBQ=MyDB.world; DBA=W; UID=foo; PWD=bar
    This requires an entry in the tnsnames.ora file that looks like this:
    MyDB.world =
    (DESCRIPTION = (ADDRESS_LIST =
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server1.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server2.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server3.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server4.intel.com)(Port = 1521)
    (LOAD_BALANCE = yes)
    (CONNECT_DATA = (SERVER = DEDICATED)
    (SERVICE_NAME = MY_SRVC))
    However, I would really like to be able to connect using ODBC without having to create that entry in the tnsnames.ora file. I have tried to substitute the DBQ=MyDB.world with the entire (DESCRIPTION=..... string from the original tnsnames.ora file, but it returns the error:
    ORA-12154: TNS: Could not resolve the connect identifier specified.
    I have heard others are able to use sqlplus with no tnsnames.ora file and the do specify the entire (DESCRIPTION=.... string on the sqlplus connection string, but is this possible to do using the ODBC SQLDriverConnect() function? If so, do I need to use a different keyword/value pair other than DBQ=?
    Any help on this would be greatly appreciated.
    Thank you.

    How would that work in a load balanced configuration? Take a closer look at the tnsnames.ora example I included in my original post. I have 4 ADDRESS= sections to denote 4 servers that are part of the load balanced environment.
    Also, I'm not familiar with that syntax, I need to use the syntax supported by the SQLDriverConnect() API function, which looks like this:
    DRIVER={Oracle in OraClient10g_home1}; DBQ=MyDB.world; DBA=W; UID=foo; PWD=bar
    I don't know as SQLDriverConnect() would accept an alternative syntax. But the more important issue here is the ability to specify those 4 servers in the load balanced configuration as indicated by that tnsnames.ora entry.

  • I can't set up gmail in my iPad 2. Keep on saying ' can't connect with SSL and ask me whether to connect without using SSL, then I press 'yes' and it said again IMAP is not working and tell me to see network connection and incoming mail server.

    I can't set up gmail in my iPad 2. Keep on saying ' can't connect with SSL and ask me whether to connect without using SSL, then I press 'yes' and it said again IMAP is not working and tell me to see network connection and incoming mail server. No idea how to do anymore. Already tried to figure out. But not work. Can anyone pls help me?

    Nope, doesn't pass verification. I get the spinner for a minute or so, then the alert about setting it up without SSL. Are you suggesting I disable Fetch and Push BEFORE I enter the account details? Because I never get past the account details screen, unless I choose "Set up without SSL" after the warning.

  • Using tnsnames.ora

    Where can I ask a questio about OCI?
    I want to make a connection using tnsname.ora except using a dblink and username and password whit oci. I used this code up to know :
    OCIInitialize((ub4)mode, (dvoid *)0,
    (dvoid*(*)(dvoid *ctxp, size_t size))0,
    (dvoid*(*)(dvoid ctxp, dvoid memptr, size_t newsize))0,
    (dvoid (*)(dvoid ctxp, dvoid memptr))0);
    OCIEnvInit(&envhp, (ub4)OCI_DEFAULT, (size_t)0, (void**)0);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&errhp, (ub4)OCI_HTYPE_ERROR,
    (size_t)0, (dvoid**)0),"");
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&srvhp, (ub4)OCI_HTYPE_SERVER,
    (size_t)0, (dvoid**)0);
    OCIServerAttach(srvhp, errhp, (text*)dblink, (sb4)strlen(dblink), (ub4)OCI_DEFAULT);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&svchp, (ub4)OCI_HTYPE_SVCCTX,
    (size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)svchp, (ub4)OCI_HTYPE_SVCCTX, (dvoid*)srvhp, (ub4)0,
    (ub4)OCI_ATTR_SERVER, errhp);
    OCIHandleAlloc((dvoid*)envhp, (dvoid**)&usrhp, (ub4)OCI_HTYPE_SESSION,
    (size_t)0, (dvoid**)0);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)username,
    (ub4)strlen(username), (ub4)OCI_ATTR_USERNAME, errhp);
    OCIAttrSet((dvoid*)usrhp, (ub4)OCI_HTYPE_SESSION, (dvoid*)password,
    (ub4)strlen(password), (ub4)OCI_ATTR_PASSWORD, errhp);
    OCISessionBegin(svchp, errhp, usrhp, OCI_CRED_RDBMS,
    OCI_DEFAULT);
    But I want to change it in a way that I can use tnsnames.ora.

    Do not pass the dblink parameter in your program, pass an empty string over there and if you are on a UNIX/LINUX set TWO_TASK to the tns alias, in your case if dblink was a valid tnx alias set TWO_TASK to dblink and run the program

  • How to use java+access connectivity without using ODBC

    Hello Sir/Madam,
    I just want to take a small help from u for using ms-access as backend to java without using the usiual jdbc:odbc bridge.
    i'll tell u the scenario which i'm facing now.
    i'm in need of sending my software(frame appl.) which uses access as backend to different agencies whom i dont even had contact. so i just dont know what is their status regarding computer knowledge, they might be data-entry-operators or of that type. so i just cant ask them to create an odbc or anything.
    so in this case is their any possibility to connect java with ms-access with out creating odbc in windows.
    please be kind to solve my problem.
    Thanking You,
    Ranjith.M

    You will need some kind of JDBC driver. And there are
    JDBC drivers available for Access that do not use
    ODBC, so you could use one of them.There are?

  • Oci_close does not release the connection when using DRCP

    Hello everyone,
    we are currently testing the deplyment of DRCP with 11g. I have the whole thing setup (correctly to my best knowledge), but I am facing an issue. The call to oci_close does not seem to release the connection to the pool as I would expect and therefore we see similar behavior like we were getting without using the DRCP.
    Our setup is using two RAC instances running 11.1.0.6.0, I am using PHP 5.1.6 with PECL installed oci8 1.3.4. The DRCP pool is configured and started, each with 100 max servers.
    When the webserver is idle it looks, well, idle.
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 0
    2 0
    The script is as simple as it gets:
    <?php
    $c = oci_pconnect('scott','tiger','IWPPOOLED');
    $s = oci_parse($c, 'select * from emp');
    $r = oci_execute($s, OCI_DEFAULT);
    oci_close($c);
    sleep(30);
    ?>
    What I would expect is that the script would connect to the pool, do the work for a tiny moment and then release the connection for usage by other script.
    But after I point the browser to the script, I get a 30 second loading time (as expected) but the server is busy all the time, like this:
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 0
    2 1
    After the 30 second sleep, it is released and busy servers are back to 0.
    If I load the server with ab using 256 connections:
    ab -n 1000000 -c 256 -k http://mywebserver/ocitest.php
    the pool is maxed out and the connects are stalling:
    SQL> SELECT INST_ID,NUM_BUSY_SERVERS FROM GV$CPOOL_STATS;
    INST_ID NUM_BUSY_SERVERS
    1 95
    2 95
    My network config for this service is following:
    IWPPOOLED =
    (DESCRIPTION =
    (LOAD_BALANCE=ON)
    (FAILOVER=ON)
    (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.33)(PORT = 1521))
    (ADDRESS = (PROTOCOL = tcp)(HOST = 10.1.16.34)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = IWP)
    (SERVER=POOLED)
    (FAILOVER_MODE=
    (TYPE=SELECT)
    (METHOD=BASIC)
    (RETRIES=5)
    (DELAY=3)
    The phpinfo() look like this:
    OCI8 Support enabled
    Version 1.3.4
    Revision $Revision: 1.269.2.16.2.38.2.20 $
    Active Persistent Connections 1
    Active Connections 1
    Oracle Instant Client Version 11.1
    Temporary Lob support enabled
    Collections support enabled
    Directive Local Value Master Value
    oci8.connection_class IWPAPP IWPAPP
    oci8.default_prefetch 100 100
    oci8.events On On
    oci8.max_persistent -1 -1
    oci8.old_oci_close_semantics Off Off
    oci8.persistent_timeout -1 -1
    oci8.ping_interval -1 -1
    oci8.privileged_connect Off Off
    oci8.statement_cache_size 20 20
    I am using the instant client for 11g
    Any ideas?
    Thanks!
    Michal

    Don't forget to use oci_free_statement($s); See "Closing Oracle Connections" in The Underground PHP and Oracle Manual. (I was just simplifying this example today for the next release of the manual).
    You may also see the "dedicated optimization", where a pooled server in a non- maxed-out pool is retained (unless needed by another PHP process) under the assumption that the initial PHP process might become active again. See http://www.oracle.com/technology/tech/php/pdf/php-scalability-ha-twp.pdf
    Feel free to email me offline (see my profile) if there are questions/data you don't want to post.
    cj
    Edited by: cj2 on Oct 16, 2008 8:12 AM

  • What is the bottom line-does new firmware allow us to use TM with Airdisk?

    Just as the topic reads - does the newly released firmware allow us to use an external HD connected to Airport Extreme for Time Machine?
    All of the Mac sites seem to report that it does - does it?
    Gregg

    It certainly seems to be supported using an AirDisk connected to my 1TB TC. I do have an AEBS but haven't tried it on that yet.

  • Connecting to Oracle database in Java using TNSNAMES.ora

    I have a program that can connect to both MSSQL and Oracle databases. It works fine when a user has defined an odbc connection, however if the user only has a tnsnames.ora, I don't know how to code the program in Java to connect to the database. I can't hard-code the server name because I don't know the database up front - I need to be able to read tnsnames.ora to get the information instead. How can I get this information? So far, the object OracleDataSource seems to be getting me the closest, however I am still failing to connect.

    In 10.2, JDBC-Thin supports TNSNAMES entries lookup in tnsnames.ora, resulting in a much simplified and driver type independent Oracle Net descriptor. You must set the system property oracle.net.tns_admin to the directory that contains your tnsnames.ora file.
    See the Oracle JDBC 10.2 doc.
    Here is a code fragment from my book (see my blog below)
    java -Doracle.net.tns_admin=$ORACLE_HOME/network/admin
    or:
    System.setProperty("oracle.net.tns_admin", "c:\oracle\net\admin");
    OracleDataSource ods = new OracleDataSource();
    ods.setTNSEntryName("tns_alias");
    ods.setUser("scott");
    ods.setPassword("tiger");
    ods.setDriverType("thin");
    Connection conn = ods.getConnection();
    Kuassi - blog http://db360.blogspot.com/

  • Can I upload PowerPoint directly into Connect without using Adobe Presenter?

    I have a PowerPoint file (.ppt as well as .pptx) and the slides are fairly simple - mostly bullet point lists in Arial or Calibri font (nothing wild and crazy).  When I upload the content directly into the Connect envrionment, the formatting of the slides (in the share pod) is all wacky.  Instead of it sizing the slides to fit the share pod, the bullet points go down past the bottom of the pod and cannot be read.
    I was told that the only solution to this is to purchase Adobe Presenter and publish my PowerPoint files (using Presenter) into Adobe Connect.  That is not an option for me at my company.  It seems like uploading a simple PowerPoint should be a basic feature of Connect without having to download/purchase Presenter licenses.  Maybe I'm wrong.  Below are a few images in case this is not making sense.  If anyone has advice, PLEASE let me know.  I cannot possibly using connect for virutal training if slides look the way they do below.  Thanks!
    The first image is the PowerPoint slide
    Here is what it looks like in the Share Pod:

    Thanks Robert,
    I tried to ask Adobe for a short list of supported / unsupported fonts but the tech kept telling me he could not give me that information.  I thought I tried Arial to no avail but I can do so again.  Just reformatted everything in Garamond and it worked fine.
    Thank you again.

  • Database connectivity without using Class.forName()

    Hi,
    Can anyone please tell how we can connect to a database without in java without using the Class.forName() method , and then how the database driver gets loaded.
    Regards,
    Tanmoy

    Hi,
    I recently wrote code that connects to a database without using Class.forName() in order to be compatible with Microsoft's JVM. I read about it here:
    http://www.idssoftware.com/faq-e.html#E1
    Basically, you create a new Driver object and use its connect method.
    Here's what my particular code ended up being:
    String url = "jdbc:mysql://localhost:3306/test?user=root&password=mypass";
    Driver drv = new org.gjt.mm.mysql.Driver();
    Connection con = drv.connect(url,null);

  • SQL developer cannot see connection info from tnsnames.ora file

    Greetings All,
    I have been using sql developer for a while. Currently on 3.0.04.34.
    I have 16 database connections.
    Everything was working fine until yesterday.
    Today when I tried to connect to a database from the list of connections I am getting following error:
    Invalid connection information specified. Verify url format for specified driver.
    When I pull up the property for this connection -connection type is still TNS, Netwrok Alias is now greyed out and what was in Netwrok Alias has shifted to Connect Identifier.
    When I try to create a new connection I do not see entry from tnsnames.ora file for the databse I am trying to connect to in the Network Alias drop down list.
    I can connect to this database from sqlplus.
    Has anyone seen this behavior? Does any one know the fix for this?
    Thanks.

    Hi,
    Maybe your preference settings got corrupted, or the Tnsnames.ora file got moved to somewhere SQL Developer can't find it.
    Are you using either:
    1. Tools|Preferences|Database|Advanced|Tnsnames Directory, or a
    2. TNS_ADMIN environment variable
    to point to your Tnsnames? Having one of those should enable the Network Alias drop-down list to get populated. Otherwise, if the values moved to Connection Identifier are correct, then you won't be to connect in that mode without also having an Oracle client installed with an 11.1 JDBC thick driver (ocijdbc11.dll).
    If there is no issue with the Tnsnames. ora location, it might be a good idea to use Export Connections to make a backup of your connections. Then you can try deleting the connections from SQL Developer and re-importing them. Even if that doesn't fix the problem, you should be no worse off.
    Regards,
    Gary
    SQL Developer Team

  • Must PMON use tnsnames.ora to locate none-defualt listener?

    Hi,
    I just want to confirm this because it is said tnsnames.ora only used for client. So I am a little confused by this usage.
    Please give some explanation about this.
    Thanks in advance.
    Br
    Martin

    tqma wrote:
    Hi,
    I notice this, "Clients and database servers (that are clients of other database servers) use the net service name when making a connection with an application."
    The statement also tells me that tnsnames.ora only is used for client role.
    Ok, my question comes from these operations;
    1. I modify the listener.ora, adding a new none-default listener, such as on port 1899.
    2. When I want to register an instance to this new listener by statements of "alter system set local_listener=...; alter system register;", it fails.
    More details, for example, I add these codes in listener.ora
    TXT_LIS=
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = fztxt)(PORT = 1525))
    Then I issue command "alter system set local_listener=txt_lis;". This command will fail.
    I need to add this in tnsnames.ora; "Txt_lis=(ADDRESS = (PROTOCOL = TCP)(HOST = fztxt)(PORT = 1525))";
    After adding the entry in tnsnames.ora, the problem is solved. When I google this, it's said PMON needs tnsnames.ora to do name resolution.
    I think PMON is a server process. So I ask if tnsnames.ora is necessary for server side in this circumstance.Since it is contacting the listener, it is acting in client role at that point.
    OK, maybe that's splitting a hair a bit to fine ...
    I'd say OK, there is one single, not often used, time when a server process uses tnsnames. But 99.999999% of the time, when people are trying to debug connection problems and can't keep straight in their mind the difference - in location and function - between client and server processes . . . it's true enough to tell them the tnsnames is used only by client processes.
    >
    Br Martin
    Edited by: tqma on May 25, 2011 10:10 AM
    Edited by: tqma on May 25, 2011 10:13 AM

  • SQL Developer cannot import connections from a tnsnames.ora

    Just try sql develorper today, I saw it can import connections from a XML file or a .properties file? But has no an option to import from a tnsnames.ora ?
    I think this should be a basic function. Did I miss it?

    You didn't answer the questions:
    Would the connection name simply mirror the tns entry? I'm not sure that'd be correct since I frequently have multiple connections defined to 1 DB ( tns entry ) If you program this "connection collection" to be performed at first startup (asking the user if he wants to), before having added any connection, you have a 1:1 relation; problem solved.
    If you want it enabled even after adding connections, you can add arbitrary suffixes (_1, _2 and so on).
    What username would be defaulted?This is even easier: none.
    That's the least the end-user can add. He can even leave it blank if he really wants to be prompted on connecting.
    K.

  • Using tnsnames.ora file instead of oracle names server

    hi,
    sqlnet.ora file contains
    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES)
    NAMES.DEFAULT_DOMAIN = (domain name)
    SQLNET.EXPIRE_TIME = 2
    DEFAULT_SDU_SIZE = 8761
    NAMES.PREFERRED_SERVERS =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = TCP.world)
    (PROTOCOL = TCP)
    (Host = oranamesrvr0. domain name)
    (Port = 1575)
    NAME.PREFERRED_SERVERS =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = TCP.world)
    (PROTOCOL = TCP)
    (Host = oranamesrvr0.domain name)
    (Port = 1575)
    There is also a tnsnames.ora file in the same path as this sqlnet.ora. Can someone tell how can i make the application use the tnsnames.ora file instead of using oracle name servers??
    Thanks in advance!!!

    917229 wrote:
    hi,
    sqlnet.ora file contains
    NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES)
    NAMES.DEFAULT_DOMAIN = (domain name)
    SQLNET.EXPIRE_TIME = 2
    DEFAULT_SDU_SIZE = 8761
    NAMES.PREFERRED_SERVERS =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = TCP.world)
    (PROTOCOL = TCP)
    (Host = oranamesrvr0. domain name)
    (Port = 1575)
    NAME.PREFERRED_SERVERS =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = TCP.world)
    (PROTOCOL = TCP)
    (Host = oranamesrvr0.domain name)
    (Port = 1575)
    There is also a tnsnames.ora file in the same path as this sqlnet.ora. Can someone tell how can i make the application use the tnsnames.ora file instead of using oracle name servers??
    Thanks in advance!!!In addition to SB's comment, keep in mind that the client only sees sqlnet.ora and tnsnames.ora that exist on the client machine .. or indicated by TNS_ADMIN as defined on the client machine. Setting this on the db server is meaningless to the client unless the client also resides on the db server.

  • Unable to connect to local database ( without using tnsname )

    hi guys
    i have 2 database running on local machine.
    db1 SID - orcl (install 1st)
    db2 SID - unicode (install later)
    Today i shutdown unicode database and stop its respective services.
    on dos
    i done a sqlplus scott/tiger, i got an error
    ORA-12560: TNS:protocol adapter error
    therefore
    i done a
    set ORACLE_SID=orcl
    and i still get the same error.
    Therefore i done the another way round. I shutdown orcl database, stop its services and STARTED unicode database and its services.
    I have remove the ORACLE_SID enviroment variable.
    Now, i issue in command prompt
    sqlplus scott/tiger
    i am connected to the unicode database!
    Now i shutdown unicode database and startup ORCL database..
    and i issue a
    sqlplus scott/tiger@ORCL..
    I HAVE No problem connecting to it..
    May i know why do i have to provide the TNSname for ORCL database and i do not have to for the UNICODE database..
    Both are local on my database.
    what is wrong ?
    by the way, i am on XP.
    thanks!

    hi paul,
    sorry for the late reply.
    I was out of town this weekend.
    thank you so much for replying..
    Here is my test results.
    inside command prompt
    (started both services - OracleServiceOrcl and OracleServiceUnicode)
    set ORACLE_SID=orcl
    sqlplus / as sysdba;
    sys@orcl> exit
    set ORACLE_SID=unicode
    sqlplus / as sysdba;
    sys@unicode> exit
    Well, if i explicity set the ORACLE_SID, it works..
    So out of curiousity, i done this testing..
    1) connect to both database and shut them down
    2) stop their services
    3) start only ORCL service
    4) close and reopen command prompt to remove the ORACLE_SID enviroment var
    sqlplus / as sysdba;
    Error: ORA-12560: TNS: protocol adapter error
    ok..
    5)now i stop the ORCL service
    6) and i start the UNICODE service
    then i issue
    sqlplus / as sysdba;
    sys@unicode>
    I have got no local or two_Task variable set, i have got no oracle_sid, nor oracle_home environment variable set.
    Any idea paul ?
    Hope to hear your advice.
    Best Regards,
    Noob

Maybe you are looking for

  • How Can I Make TouchEvent.TOUCH_BEGIN work for a Slider?

    Hi, I'm building an application that has a slider. The slider works great using TOUCH_BEGIN, TOUCH_MOVE, and TOUCH_END events. The problem occurs when the user is touching anywhere else on the screen then uses another finger to move the slider at the

  • How to improve the performance of adobe forms

    Hi, Please give me some suggestions as to how to improve the performance of adobe form? Right now when I' am doing user events it is working fine for first 6 or 7 user events. From the next one it is hanging. I read about Wizard form design approach,

  • SAP Strategy Management - Under BO or BI

    Hi, In one place (help.sap.com), I see Strategy Management included under SEM (so I assume it is under BI)  where as in another place (sap.com), it is included under Business Objects. Can someone please guide? Or, are those two different applications

  • List of script and smart forms(except TNAPR) with output type or print prog

    How to find out List of SAP SCRIPT and SMART FORMS (except TNAPR)with output type or print program..I like to chk in output type WMTA  whch form should use.kindly help on this

  • Authentication in weblogic 5.1

    Hi all, I have the following requirements. I have an application which asks for the authentication information like username and password at first. The application is running in weblogic5.1 server. Is there a way where in weblogic.properties file, i