Launch ODBC data source window in Java

Hi , In windows OS , when config the database data source ,I have to launch the ODBC data source administrator window in the control panel , I think this is a troubled thing .Can I call the window in java program directly ? Thanks.
Liwei

I read this recently on this Forum. So, yes .. apparently it can be done.
<------ Search 'DB' etc - by date and look for something 2 days back. Also if you check the New To.. forum I posted a jdbc.odbc program about 5 days back to test your driver. Good luck (actually this is a bit tricky the first time, so keep at it)

Similar Messages

  • Automatic Creation of ODBC Data Source From Within Java App

    Good Day Good People :)
    I was wondering if it were possible for a java application to automatically set up an ODBC data source for a JDBC connection in a windows environment.
    This is the method I call to initialise a connection to my database:
    public void initialiseLocalConnection ()
    url = "jdbc:odbc:ICUDB";
    try
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    icuCon = DriverManager.getConnection (url);
    catch (Exception e)
    JOptionPane.showMessageDialog (null, "Error Creating Connection to ICU Database!\n" +
    "Please set up an ODBC data source pointing\n" +
    "to the icudb.mdb file located in the data\n" +
    "folder of the ICU directory and call the\n" +
    "connection 'ICUDB'.", "Database Connection Error", JOptionPane.ERROR_MESSAGE);
    Is it possible to create the ODBC data source ICUDB if it does not exist from within my application.
    All information regarding the possibilty and the application of doing this would be greatly appreciated.
    Kind Regards
    Matt

    Thank you.
    During my search I for dsn-less connections I found the soloution:
    url = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" +
    System.getProperty ("user.dir") + System.getProperty ("file.separator") +
    "data" + System.getProperty ("file.separator") + "icudb.mdb";
    try
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
    icuCon = DriverManager.getConnection (url);
    This works.
    Thanks for the replies.
    Matt :)

  • Call ODBC Data Source Administrator dialog from java code

    Hai all
    Is it possible to call "ODBC Data Source Administrator dialog " using java code.
    Tell me whether it is possible or not?
    If yes then kindly give the code please.

    try{
    Runtime.getRuntime().exec("odbcad32.exe");
    } catch(Exception e){
    e.printStackTrace();
    }or
    try{
    ProcessBuilder pb = new ProcessBuilder("odbcad32.exe");
    pb.start();
    }catch(IOException e){
      ioe.printStackTrace();
    }make sure path variable has %SystemRoot%\system32; value.
    guess both have to work... :)
    NOTE: It is OS Dependent (specially for MS WINDOWS based OS's) & the second method would work for Jdk versions of 5.0 & above..
    Hop this would be of some help :)
    REGARDS,
    RaHuL

  • Cannot get ODBC data source to talk to Oracle 10g for Windows

    Problem description
    I recently installed Oracle 10g on my laptop computer, which is running Windows 7. Everything went smoothly except for one crucial item: The ODBC data source I added keeps returning this error when I click the "Test Connection" button:
    Testing Connection
    Unable to connect
    [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_HANDLE_ENV failed.
    I was using the following ODBC driver
    Oracle in OraDb10g_home1 (TNS Service Name = ORCL and User ID = scott)
    This type of error happened, in one form or another for the three other Oracle drivers I have on my machine
    Microsoft ODBC for Oracle
    WinSQL Oracle
    WinSQL Oracle Wire Protocol
    These services are currently running (status = Started)
    OractDBConsoleorcl
    OracleMTSRecoveryService
    OracleOraDb10g_home1iSQL*Plus
    OracleOraDb10g_home1TNSListener
    OracleServiceORCL
    (NOTE: I entered the foregoing information by hand, since I was not able to copy-and-paste it. So be aware that there is a small possibility of a minor typo in case you plan to cut-and-paste it.)
    If requested, I can provide the contents of these files
    tnsnames.ora
    sqlnet.ora
    listener.ora
    Other installations on the same computer
    ODAC (ADO data provider for Oracle)
    SQL Server 2009 Express
    .NET 4
    Visual Studio 2010
    Any help would be greatly appreciated!

    OK, I went ahead and upgraded to Windows 7 Professional and I STILL get the same error messages when trying to get the Oracle ODBC driver to talk to Oracle 10g. Here are some screen shots that show what happened:
    1) Select ODBC driver: http://yfrog.com/f3driverselectionp
    2) Configure driver: http://yfrog.com/ccoracleodbcfororaclep
    3) Test connection: http://yfrog.com/1goracleodbcfororacletestp
    I also get the following error when I try to run SQL*Plus from the line command, even with no parameters:
    C:\Users\Bruce>sqlplus
    SP2-1503: Unable to initialize Oracle call interface
    SP2-0152: ORACLE may not be functioning properly
    Any suggestions as to how I might to go about diagnosing (and fixing) this problem?
    Thanks,
    Bruce

  • Problem opening ODBC data source in Windows 2003

    I am having difficulty opening a ODBC data source in SQL
    Server 2000 running on Windows 2003 using ColdFusion MX7 (it works
    cleanly on the same database on windows 2000 server). Anyone has
    any ideas.

    Here it is, there is an issue with our Search functionality with the new SDN:
    Symptom
    When setting location on a Crystal Reports XI Report using the Progress OpenEdge ODBC Driver in Crystal Reports 2008 or Crystal Reports 2011 get “Some tables could not be replaced, as no match was found in the new data source.  Please specify the table required for any unmodified tables.”
    Environment
    Crystal Reports 2008 or 2011 
    Progress OpenEdge ODBC Driver
      Reproducing the Issue 
    Open a Crystal Report created in CR XI Report using the Progress OpenEdge ODBC Driver in Crystal Reports 2008 or 2011 
    Set location to a new ODBC Data Source 
    Get error "some tables could not be replaced, as no match was found in the new data source.  Please specify the table required for any unmodified tables.”
    Cause
    Crystal Reports XI only creates aliases for tables with special characters or duplicate names.
    Crystal Reports 2008 introduces a change which requires aliases for all tables.
    Aliases are not created when doing a Set Location on the whole data source.
    If a Customer has hundreds of reports they cannot set location of each table and fix the aliases.
    Resolution
    Upgrade to Crystal Reports 2011 Support Pack 02 or higher 
    Under registry key [HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\ODBC] create string UseTableNameAsAlias and set it to PGPRO1019.DLL, PGOE1022.DLL. Registry file is attached.
      Keywords 
    Set Location 
    Progress ODBC 
    Crystal Reports 2008 2011

  • Setting Up an ODBC Data Source in Windows XP for PostgreSQL Unicode

    Can someone help me setup an ODBC data source for a PostgreSQL Unicode database?
    1.  Under which tab(s) should I setup the Data Source:  User DSN, System DSN, File DSN?
    2.  The check boxes on Advanced Options Pages 1 and 2, which should be checked?
    I have Crystal Report XI, Windows XP, and PostgreSQL Unicode Version 08.1.0100.
    Thanks!
    Glynn

    Here it is, there is an issue with our Search functionality with the new SDN:
    Symptom
    When setting location on a Crystal Reports XI Report using the Progress OpenEdge ODBC Driver in Crystal Reports 2008 or Crystal Reports 2011 get “Some tables could not be replaced, as no match was found in the new data source.  Please specify the table required for any unmodified tables.”
    Environment
    Crystal Reports 2008 or 2011 
    Progress OpenEdge ODBC Driver
      Reproducing the Issue 
    Open a Crystal Report created in CR XI Report using the Progress OpenEdge ODBC Driver in Crystal Reports 2008 or 2011 
    Set location to a new ODBC Data Source 
    Get error "some tables could not be replaced, as no match was found in the new data source.  Please specify the table required for any unmodified tables.”
    Cause
    Crystal Reports XI only creates aliases for tables with special characters or duplicate names.
    Crystal Reports 2008 introduces a change which requires aliases for all tables.
    Aliases are not created when doing a Set Location on the whole data source.
    If a Customer has hundreds of reports they cannot set location of each table and fix the aliases.
    Resolution
    Upgrade to Crystal Reports 2011 Support Pack 02 or higher 
    Under registry key [HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Database\ODBC] create string UseTableNameAsAlias and set it to PGPRO1019.DLL, PGOE1022.DLL. Registry file is attached.
      Keywords 
    Set Location 
    Progress ODBC 
    Crystal Reports 2008 2011

  • ODBC driver not recognized by Windows ODBC Data Source Administrator

    Using Windows XP Professional with all patches. I installed Oracle 10g Client, then removed ODBC driver and loaded 10.1.0.1.3 ODBC driver. Windows ODBC Data Source Administrator will not see this driver. (It also didn't see the previous driver, which is why I tried the new one.) The driver is in the registry (HKEY_LOCAL_MACHINE: SOFTWARE\ODBC\ODBCINST.INI) properly configured. It was not in the odbcinst.ini (Windows directory) file however, so I manually added it. I found directions on this site to be sure the drivers were loaded in the Oracle home directory, which is where I put them.

    Hi Joe,
    According to your description, after you run C:\Windows\SysWOW64\odbcad32.exe, Access driver is not displayed when you expand HKEY_LOCAL_MACHINE>ODBC>ODBCINST.INI node.
    The issue is caused by wrong path of odbccad32, please make sure that you are using Administrator account or you have administrative privileges, then refer to the following steps:
    Go to Control Panel.
    Click Administrative Tools.
    Right-click Data Sources(ODBC) to open Properties dialog box.
    In Target text box, type  %windir%\syswow64\odbcad32.exe             
    In Start in text box, type %windir%\syswow64, then click OK to  save the settings.
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu

  • Excel-2007 cannot connect to Oracle ODBC data source, Control Panel can.

    <p>
    I cannot make an ODBC connection from Exce-2007 to Oracle work. I am an expert Excel and VBA user (since 1994) and I have frequently used Excel to access ODBC databases, including Oracle (I have done this with Excel-2003 both with worksheet queries and have written VBA ADO-connection routines). And even though in Excel-2007 a worksheet ODBC query is supposed to be easier to create than in previous version of Excel, my connection fails. Any suggestions and all help are welcome and much appreciated.
    DETAILS
    </p>
    <p>
    1) <strong>What is my system?</strong> I am using Excel-2007 on Windows Vista x64 and Oracle server v.11g on my computer (all this is on my computer, no network issues).
    2)<strong> Why use Excel with Oracle at all?</strong> I use Excel-2007 to access Oracle rather than Access-2007 (or any other application like TOAD, etc.) because I do engineering calculations with the data stored in Oracle. These calculations are easier done in Excel (I suppose that one alternative to this could be to use some sql or Access to get the data from the database, then store it as plain vanilla CSV file, then open this file in Excel, then do the math (the math involves complex optimisation algorithms), then save the results as CSV, then use some sql or Access to put the data back into the database. Howwever this does not strike me as a quick or neat solution. And after all Excel has been designed to access ODBC databases, so why not use it?)
    3) <strong>What do I do in Excel-2007 that won't work?</strong> I create an ODBC link to Oracle that does not work. In Excel-2007 this is straightforward:
    </p>
    <ul>
         <li>define an ODBC connection (Data tab --&gt; From other sources --&gt; From data connection wizard);</li>
         <li>define a query on the worksheet -- that's it, this is all!</li>
    </ul>
    <p>
    I start with creating an ODBC connection:
    a) I choose an ODBC data source type: <strong><em>ODBC DSN</em></strong>
    b) Excel-2007 displays the list of the available ODBC data sources. I see in it <strong><em>my Oracle database name</em></strong> and I select it.
    c) Excel-2007 displays the Data Link Properties:
    - the "Provider" has a list of the OLE DB drivers with preselected "<strong><em>Microsoft OLE DB Provider for ODBC Drivers</em></strong>". I keep this default selection.
    - the "Connection" tab has a connection string "<strong><em>DSN=&lt;my database name&gt;</em></strong>" which I keep, it also has fields for the <strong><em>user name</em></strong> and the <strong><em>password</em></strong>, which I fill with the correct credentials.
    - Finally there is a button "Test Connection", which when I click produces the following error message:
    <strong><font color="#ff0000">"Test connection failed because of an error in initializing provider.</font></strong><strong><br />
    </strong><strong><font color="#ff0000">Unespecified error"</font></strong><strong>
    </strong>
    4) <strong>Additional food for thought:</strong>
    a) In the above walk-through the only data, which I type, are the user name and password, everything else is selected from lists offered by Excel-2007, hence any possibility of typos being the cause of the problem can safely be discarded.
    b) I can test the ODBC driver in the Control Panel and it shows that it can connect to the Oracle database:
    - in <strong><em>Control Panel --&gt; Admin Tools --&gt; Data Sources (ODBC)</em></strong> on the "User DSN" tab I can see the list of the available ODBC data sources (same list as in Excel-2007, point 3b above) with the name of my database in it;
    - selecting the name of my database from the list of the sources and clicking "Configure" button opens a tab with <strong><em>Data Source Name</em></strong> (same as in Excel-2007), TNS Service Name and User ID. I enter <strong><em>&lt;user name&gt;/&lt;password&gt;</em></strong> and click "Test Connection" button. A message "<strong><em>Connection successful</em></strong>" appears (just for a test I enter <u>incorrect user credentials</u> and "<strong><em>Unable to connect</em></strong>" message appears)
    BOTTOM LINE
    </p>
    <p>
    The procedure for using an ODBC connection from Excel is very simple, in the past I have created and used such connections numerous times with Excel-2003 and earlier on Win-XP and earlier. But now on Excel-2007 and Vista-x64 I cannot make it work.
    Also, testing an ODBC connection driver is really easy and simple to be done in the Control Panel. There testing the same ODBC connection, which fails in Excel-2007, results in success.
    I am frustrated by the simplicity of the problem and yet the persistant error. I have lost now two full days in failed attempts to make the simple procedure work and in searching the internet for answers.
    All help is highly appreciated <img class="emoticon" src="images/emoticons/happy.gif" border="0" alt="" width="16" height="16" />,
    Plamen
    </p>

    Did you find the solution to your problem?
    If not, I think I may know.
    Excel 2007 is a 32-bit application.
    When installing 32-bit applications in a 64-bit environment, the "default" location is:
    C:\Program files (x86)\...
    Excel then launches from this location.
    However, when it connects to Oracle and passes the name of the calling program, Oracle attempts to "interpret" the value of (x86) as if
    the value within the parenthesis are being passed as a reference. Of course, iOracle doesn't find anything, so the result is (),
    and then it cannot return the connection info back to the calling application.
    I corrected it by installing Excel in C:\Program Files\, and once launched from that location, it works the same as on the 32-bit machines.
    However, at my location, they are FORCING Excel to be installed in the(x86) location.
    What I'm trying to discover now is:
    Is it possible to flag Oracle to NOT process the embedded variables?
    Or, is it possible to assign a variable in Oracle such that x86 = "(x86)", so that the end result is viable?
    Have you had any luck with your installation?
    thanks,
    Paul

  • Cannot see System DSN ODBC Data source (however user DSN is Ok)

    We have installed BO 6.5.1 on Windows 2008 R2 64 bit and set up ODBC Data source to the existing SQL server.
    When we try to set the BO up (Administration>Safe recovery etc.), in the "Database middleware selection" - "Define new connection" - "Data source name" we cannot see the System DSN name that we've created in the Window's "ODBC data source administration" control panel applet. If we create a User DSN, we can see it ok but it works for one user only (as it should).
    So, in a nutshell, if we setup a User DSN it works fine but if we setup a system-wide System DSN BO cannot see it. I've got no idea why...
    Can anyone point me to the right direction, please?

    Are you using the ODBC Administrator from control panel?  If so, try launching this instead:  odbcad32.exe from start/run.
    This is the 32-bit ODBC administrator and since we are a 32-bit application, a 32-bit DSN will need to be configured.
    Here's another forum thread that may be helpful:
    http://social.msdn.microsoft.com/Forums/en/sqldataaccess/thread/49e206c3-f4f8-4757-8990-71b93120d2bc
    and this one too:
    http://forums.techarena.in/windows-x64-edition/698703.htm
    Thanks
    Jonathan

  • List odbc data-source names

    hello,
    i would like to show (System.out.println) all odbc data-source names,
    which are installed on the machine. whats a common way?
    can somebody help me please? thanks!
    regards.

    Sorry there is no such mehtods or classes in java
    for doing this activity
    one thing u can do is this
    i dont dont know much about windows programming
    but i think that we we manually created a datasource by click odbc tab and then adding a datasource assosiating a mdb file to it
    then in wondows surely some where it must have registerd
    say for example there must be a datasource .ini file
    now if this is true then u can do one thing
    .ini file is similar to a text file
    u can read this file thru FileReader class
    and just extract the name sof datasource this is the obly option
    \u just need to find where this datasource.ini file is located if at all it is
    if u satisfied with my answer i am waiting for my dukes
    bye

  • Multiple excel files - ODBC Data Source Administrator

    I have about 1750 excel files that I need to convert to text format.
    Is it possible to ... configure all files in the ODBC Data Source Administrator window?

    If you need these DSNs for Java only, you can define them directly inside the connect string.
    Look at these previous topics:
    http://forum.java.sun.com/thread.jsp?forum=48&thread=150956
    http://forum.java.sun.com/thread.jsp?forum=48&thread=218662
    Call again, if you don't succeed.

  • Data source creation with XEClient driver crashes ODBC Data Source Admin.

    OS: Windows XP Professional SP2
    How to reproduce:
    1. Install Oracle XEClient 10g from: http://www.oracle.com/technology/software/products/database/xe/htdocs/102xewinsoft.html
    2. (optional) You may need to install MSVCRT71.DLL and MFC71.DLL (see Re: odbc error in XE and 9i
    3. Open Control Panel
    4. Double-click on the Administrative Tools icon
    5. Open Data Sources (ODBC) applet.
    6. Click Add button
    7. Select Oracle in XEClient
    8. Name the Data Source.
    9. Press OK
    10. Double-click on the Data Source. The ODBC Data Source Administrator crashes.

    OS: Windows XP Professional SP2
    How to reproduce:
    1. Install Oracle XEClient 10g from: http://www.oracle.com/technology/software/products/database/xe/htdocs/102xewinsoft.html
    2. (optional) You may need to install MSVCRT71.DLL and MFC71.DLL (see Re: odbc error in XE and 9i
    3. Open Control Panel
    4. Double-click on the Administrative Tools icon
    5. Open Data Sources (ODBC) applet.
    6. Click Add button
    7. Select Oracle in XEClient
    8. Name the Data Source.
    9. Press OK
    10. Double-click on the Data Source. The ODBC Data Source Administrator crashes.

  • How can I delete an ODBC data source after 10g client has been uninstalled?

    I uninstalled the 10g client and now when I attempt to delete the ODBC data source, I get an error: "The setup routines for the Oracle in Oraclient10g_home2 ODBC driver could not be found. Please reinstall the driver. I re-installed the client and I get the same error, but I had to specify a new home. I still get the error. Anyone have an answer or a workaround to deleting the ODBC entry so that I can re-create with the same name later under the 9i client?

    I have the same problem... and nobody gots the point:
    1st. the ODBC and the client/home exists on the machine...
    2nd. the client/home is unistalled and so...
    3rd. tada! Now we have a impossible-to-unistall ODBC entry!
    That is happening on a Windows, at last to me...
    Please, help us if someone knows how to remove this ODBC entry... if know how to DO the stuff (permissions, system, all that things is answered above).
    Best regards,
    Bruno Araujo

  • Why do SQL sample programs work when there is no entry for the data sources in the ODBC Data Source Administrator that are used by the sample program?

    Hi,
    I am trying to understand how to access an SQL database from CVI.  
    I don't understand how the sample programs shipped with the toolkit can access the database they use if it is not listed in the ODBC Data Source Administrator.
    In the code, I see the line:
    hdbc = DBConnect ("DSN=CVI SQL Samples");
    However, there is not an entry that I can find in the ODBC Administrator for "CVI SQL Samples."
    The SQL help suggests there should be a User DSN named, "CVI32_Samples", but I don't see that entry in the ODBC Administrator on my win-7 system.
    I believe the sample program is accessing a database file named, "C:\Users\Public\Documents\National Instruments\CVI\Samples\sql\samples.mdb".
    Exactly how is the call to DBConnect() translated to the file, "samples.MDB", if there is no entry in the ODBC Administrator?
    Regards,
    Mark 

    I figured it out.  There is a 32 bit ODBC administrator and a 64 bit ODBC administrator.  The ODBC administrator I run through the control panel is the 64 bit ODBC administrator. To access the 32 bit administrator I need to run, "C:\Windows\SysWOW64\odbcad32.exe".
    I am running the samples in 32 bit mode, so I need to use the 32 bit ODBC administrator.
    Best,
    Mark

  • Instant client installation unavailable in ODBC data sources

    I'm trying to install instant client to enable MS Excel to access an Oracle database. OS is Windows 7.
    After installing instant client plus the odbc package, I can't see a new entry in the odbc data sources - only the standard Microsoft sources (Excel, Access, SQL Server) show up.
    There's also an Oracle SQL developer installation on my computer. Connection to the database works fine in SQL developer - so the DB does exist and it is accessible.
    Steps conducted during instant client installation:
    - Downloaded basic lite instant client (11.2.0.3.0) for windows.x64
    - Downloaded odbc package for windows.x64
    - unpacked zip file to instantclient directory
    - executed the odbc_install.exe in the instantclient directory. I'm not sure if this install.exe does anything at all. There was no error message but also no confirmation or reaction of any kind.
    - executing the install file from the cmd window gave me a message, that the odbc drivers were already installed. So I guess odbc_install.exe was executed properly
    - setting some system variables
         1) path variable: added instantclient directory to the ones already listed in path
         2) tns_admin: new entry, pointing to instantclient directory
         3) ld_library_path: new entry, pointing to instantclient directory
    - wrote an tnsnames.ora file using the connect information also used in SQL developer
    - saved tnsnames.ora file in instantclient directory
    - rebooted computer to activate changes
    When opening the odbc data source administration, I'm only able to see Microsoft drivers for Access, Excel, SQL Server. I'd expect to get an Oracle driver option to add to the installed drivers.
    Wild & uneducated guesses about what might cause the problem:
    - IC is installed on E: drive. Maybe some component is expected to be saved on C: (low likelihood, many others would have complained by now)
    - Win 7 often asks for explicit permission to do this or that via popup windows. Maybe the odbc-component encounters such a request ans says "Ummm....???"
    Any idea, what I might try to get an oracle entry in the odbc data source list?
    Best regards
    Peter
    Edited by: 1003309 on 30.04.2013 05:33

    I'm not sure to be honest, but what I downloaded did not have a setup.exe.
    Does what you're talking about allow you to connect to Oracle databases via ODBC? If so, is it downloadble from the Oracle site?

Maybe you are looking for

  • CCMS for application errors in SAP R/3

    Hi Experts, I am working on File->ABAP Proxy scenario. My client has configured CCMS in solution manager system to receive alerts from PI as well as from SAP ECC system. One thing which is not clear to me is how to capture the application errors rais

  • I Keep Receiving The Same Text Messages Multiple Times

    Every single time someone texts me, it doesn't matter who, I will receive the same message from them multiple times. At first I thought it was just them resending their message but I asked and they said no. After a few days it started happening with

  • Why we need live cache along with RDB in APO

    Hello Expert, I recently entered to APO module so want to know about live cache and why we really need comparing to RDB and what RDB cannot do that live cache can do?

  • How to order Competencies on apprails employee view on sshr on r12

    Hello, i'm working on r.12.1.3 of e-business suite, module Human Resource. In Self Service, on the "Employee: My Appraisals Page", how can I personalize appraisal sorting of competencies based on competence_type lookup? And also, in the previous rela

  • ColorSync can't repair a profile

    I have noticed that some of my pics I convert in Adobe photoshop CS won't open or aren't recognised and become exec files. I get this note after using the colorsync utility........ Searching for profiles... Checking 911 profiles... /Library/ColorSync