How to read System DSN entries -Urgent

Hi,
I need to show list of System DSN entries in JComboBox. So, I want to know the way of reading the entries in Java. Can you please help me ??
Thanks in Advance
Kumar

please stop posting this question.
the answer.. which you already know is JNI or native code. but a better question which was already asked of you is WHY do you want to show a list of available DSN's on a machine? it sounds like using a dynamic DSN would probably help you.
please see here...
http://forum.java.sun.com/thread.jsp?forum=48&thread=200603
if dynamic DSN's will not help you and you MUST retrieve a list of DSN's available on a system you are looking at native code to do this... good luck.

Similar Messages

  • How to read system eventlog using java program in windows?

    How to read system eventlog using java program in windows?
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Hi,
    There is no java class for reading event log in windows, so we can do one thing we can use windows system 32 VBS script to read the system log .
    The output of this command can be read using java program....
    we can use java exec for executing this system32 vbs script.
    use the below program and pass the command "eventquery"
    plz refer cscript,wscript
    import java.io.*;
    public class CmdExec {
    public static void main(String argv[]) {
    try {
    String line;
    Process p = Runtime.getRuntime().exec("Command");
    BufferedReader input =
    new BufferedReader
    (new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    input.close();
    catch (Exception err) {
    err.printStackTrace();
    This sample program will list all the system log information....
    Zoe

  • How to read system evenlog using java program in windows

    How to read system evenlog using java program in windows???
    is there any java class available to do this ? or any one having sample code for this?
    Your friend Zoe

    Welcome to the Sun forums.
    >
    How to read system evenlog using java program in windows???>
    JNI. (No.)
    >
    is there any java class available to do this ? or any one having sample code for this?>You will generally get better help around here if you read the documentation, try some sample code and come back with a specific question (hopefully with an SSCCE included).
    >
    Your friend Zoe>(raised eyebrow) Thank you for sharing that with us.
    Note also that one '?' denotes a question, while 2 or more generally denotes a dweeb.

  • How to read system memory size, processor speed of a system

    Hi all,
    How to read system memory size, processor speed of a system and how to read how much of it are in use in a running system. (using java)
    any help would be great.
    -thanks

    How to read system memory size, processor speed of a
    system and how to read how much of it are in use in a
    running system. (using java)Using Java: not at all. You'll need JNI.

  • How to read user - logon language (Urgent)

    Hi All,
    I have written the below code to display the language in english if it exists if not in french & so on, but i would like to know how i can read the language in which the user has logged on & use that as the first criteria.
    Eg: S_SPRAS = User Logon language
    SELECT SINGLE MAKTX FROM MAKT INTO Y_MAKTX
      WHERE MATNR = MARC-MATNR
        AND SPRAS IN (S_SPRAS,'EN','FR','IT',' ').
    Hope my problem is clear, await inputs.
    Vivek

    Hi,
    Let me try to explain the problem
    Mtl-A, has description in 3 languages. (En, Fr, It)
    Mtl-B, has description in 1 language only. (It)
    Mtl-C, has no description
    First i want to check for a given mtl if description exists in the user's logon lang, if it does not, then check if description is maintained in English, if not check in French, if not Italian.
    Eg1: User logs-in with En language,
    Then the description for mtl-A is displayed in english, for Mtl-b description is displayed in Italian (as only italian description is maintained) & for mtl-c no description is displayed as it is not maintained.
    Eg2: User logs-in with It language.
    Then description for Mtl-A & B is displayed in Italian & for mtl-c it is blank as no description exists
    But when i use the below code, the system by default picks up EN which is my default lang, even if i login in French or Italian lang, the description is shown in english only.
    SELECT SINGLE MAKTX FROM MAKT INTO Y_MAKTX
      WHERE MATNR = MARC-MATNR
        AND SPRAS IN (SY-LANGU, 'EN', 'FR', 'IT').
    Hope i was able to put across my problem clearly.
    Await inputs.

  • How to read system user and password to login to a application

    Hello Experts,
    i need to open a application with out asking for the user name and password. the application when opened should take system user name ans password can u tell me how can i do this in webDynpro java. or is there any alternate method to do this

    hello,
    This can be achived in following manner,
    1) Ask ur basis peron to creat ur id on the server (for ex. if u are using a dev server ask him to creat a user their)
    2)Now Logon to your user id n system password
    it will take you to the portal and the roles assigned to you by basis.
    Result:
    u will be able to see a portal logged in by your name and rols assigned to u
    With Regards,
    Prajakta

  • Remove odbc system dsn using batch file and odbcconf

    I create user system dsn entries by using a batch file and odbcconf call.  I've found references here on how to do that, yet cannot seem to find any results on how to remove them using that same call.  The library information (http://msdn.microsoft.com/en-us/library/ee388579(VS.85).aspx) states add and modify a system dsn for configdsn and configsysdsn and references equivalent to SQLConfgDataSource function. (http://msdn.microsoft.com/en-us/library/ms716476(VS.85).aspx) but the config data source function has a a removal and this doesn't seem too. 
    Apologies for being obtuse, but I can't seem to locate it.  Any links to how this is done from a batch file are much appreciated.
    Regards,
    NR.

    John C is basically correct, you can remove a System ODBC data source via the registry, but there is apparently no way via odbcconf.exe.  That is of course really stupid and poor programming!
    John, however, forgot another important registry entry.  That key deletion he mentioned will disable the odbc connection, but not remove it entirely.  If you just do that and then open the "ODBC Data Source Administrator", you will find the
    connection is still listed, but you can't remove it or modify it.  It becomes completely screwed up! There is a value to delete as well which dictates if the connection is listed.  Consider it the "header" to the data source.
    Also, in Windows 2003 and 2008 at least, the registry key John C listed is not quite the location to modify either.  This is where to find them in those OSs:
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DSN%
    or
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DSN%
    The "header" I reffered to is a string value in inside a key (not the whole key!)
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
    or
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
    The string value is the data source name.  This entry must be removed to remove the data source listing entirely.
    Here are some batch snipets for creating and then removing an odbc data source.  I'm leaving out some premiliary chunks, but you can figure it out from here. If you can't, you probably shouldn't be messing with this stuff in the first place!
    In these scripts, I create and remove a 32-bit data source in either a 32-bit or 64-bit version of windows.  The windows folder variable gets set to either "C:\Windows\System32" or "C:\Windows\SysWOW64" depending on the os.  In case you didn't
    know, on a 64-bit machine there is are also 2 differrent versions of the "ODBC Data Source Administrator" gui tool and the data source lists differ (32-bit vs 64-bit lists).  The 32-bit version on a 64 bit OS is found at "C:\Windows\SysWOW64\odbcad32.exe". 
    The one in the start menu will load the 64-bit version so you will never find your 32-bit connections there.
    Note - for simplicity I use the database name as the user name and and the data source name as well (in case there was any confusion). 
    Create the connection like so:
    echo Creating 32-Bit System ODBC Connection "%DatabaseName%"...
    "!WindowsFolder!\ODBCCONF.EXE" CONFIGSYSDSN "!ODBCDriver!" "DSN=%DatabaseName%;Server=localhost;Port=3306;Database=%DatabaseName%;UID=%DatabaseName%;PWD=%DatabasePassword%"
    And then remove it like this:
    echo Removing 32-Bit System ODBC Connection "%DatabaseName%"...
    if "%WindowsBits%"=="32" (
    If Exist "!TempRegFile!" Del "!TempRegFile!"
    echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
    echo.>>"!TempRegFile!"
    echo [-HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
    echo "%DatabaseName%"=->>"!TempRegFile!"
    regedit /s "!TempRegFile!"
    ) else (
    If Exist "!TempRegFile!" Del "!TempRegFile!"
    echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
    echo.>>"!TempRegFile!"
    echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
    echo "%DatabaseName%"=->>"!TempRegFile!"
    regedit /s "!TempRegFile!"
    If Exist "!TempRegFile!" Del "!TempRegFile!"

  • DSN Entry for Connection to an Excel-Sheet

    hi,
    i must create a DSN entry on unix to connect to an excel sheet. adding a new dsn entry on windows is the following way: Start | Settings | Control Panel | Administrative
    Tools and so on. Has anybody an idea how to create a dsn entry on unix?
    regards,
    thomas

    as far as I know, UNIX does not natively support ODBC.
    check for other solution such as open source at link:
    http://en.wikipedia.org/wiki/UnixODBC
    Good luck.

  • Reading system profile parameters programatically in ABAP

    Hi,
    Does anyone know how to read system profile parameters like icm/host_name_full using ABAP?
    Thanks in advance!
    Regards
    Erick

    You can use the following code to get the values.  Really it is just reading a file which is stored on the application server.
    report zrich_0001.
    types: begin of tpar,
           status type sy-index,
           name(60) type c,
           user_wert(60) type c,
           default_wert(60) type c,
           end of tpar.
    data: par_usub type table of tpar  with header line.
    data: par_sub  type table of tpar  with header line.
    call 'C_SAPGALLPARAM' id 'PAR_USUB' field par_usub-*sys*
                          id 'PAR_SUB'  field par_sub-*sys*.
    loop at par_usub.
      write:/ par_usub-name(30), par_usub-user_wert(20),
              par_usub-default_wert(20).
    endloop.
    Regards,
    RIch Heilman

  • How to read fieldcatalog of Data Entry View in CAT2

    Hi,
         I have a requirement wherein I need to validate the time data of 'Data Entry View' in TCode: CAT2. Here, there is a table control which uses dynamic field catalog (for days Eg: MO 11/07, TU 11/08.....SU 11/13).
           Whenever a user enters the 'Key Date' from CAT2, the system automatically gets the Data Entry Period of that Key date.
    For eg, let's say user enters Key date as '11/28/2011' then the Data entry period would be 11/28/2011 to 12/04/2011.
          Requirement: Now the system should allow the user to enter time for November month only i.e. 28, 29 and 30. It should not allow the user to enter time data for December. In short the system should allow the user to enter times of only one month.
          For this validation I'm using the User Exit: CATS0006 .  Please suggest me how to read the above fieldcatalog,
    And also let me know if this can be achieved by any other method.
    Thanks,
    Singh

    Thanks Raymond. The problem is solved.
    Below is some part of the logic...
    Work area declaration
    DATA: wa_check_table TYPE cats_comm.
    Variables
    DATA: w_cnt TYPE i.
    Get the no. of records
    DESCRIBE TABLE check_table LINES w_cnt.
    Read the last record
    READ TABLE check_table INTO wa_check_table INDEX w_cnt.   "We can loop also
    IF dateto4(2) GT datefrom4(2).
      IF wa_check_table-workdate4(2) GT datefrom4(2).
        MESSAGE e208(00) WITH text-001.  "Appropriate Error Message
      ENDIF.
    ENDIF.

  • I've accidentally deleted the System Administrator entry in Directory Utility. How do I recreate it?

    How do I recreate the "System Administrator" entry in Directory Utility. It was accidentally deleted.

    If you see this article: http://www.stupidlittleblog.com/2011/technology/apple/mac-os-x-lion/mac-os-x-lio n-root-user-sigin-error/#.To_DWOsb6jV
    I was having the same root user password login problem.
    So I followed the instructions in it, but instead of deleting "AuthenticationAuthority" setting for System Administrator, I accidentally deleted the whole "System Administrator".
    Therefore, I'll need to recreate the "System Administrator" entry in the Directory Utility. Maybe you can send me a screen capture of the System Administrator settings so I can try to recreate it. Or else if you know how I can recreate is (maybe from Terminal command line), it will be appreciated.
    Thanks.

  • How to read and display table data entries from ERP in CRM

    Hello experts,
    I am new to CRM. I need to read data base entries from ERP in CRM system. What would be the best way to do . The table is a standard SAP table with a custom include (several customer fields). Calling a web service would be the best way..? or is there any other way that I can do it too.
    Also, to display these entries what would be the best tool? Should I built my own transaction/report to do it?
    Any advise or guidance would be a great kick start to learn the CRM development environment.
    Regards,
    jaffery

    Hi,
    Check the below wiki link if it helps.
    http://wiki.sdn.sap.com/wiki/display/CRM/Howtodisplayaz-tableinanassignmentblock
    Also, you can try an option of transaction launcher.
    Hope this helps.
    Regards,
    Chandrakant

  • How to use VBScript to access a 32bit ODBC System DSN (Excel) on a Windows 7 64bit system?

    What is the correct way to connect to a 32bit System DSN (Excel) on a Windows 7 64bit system?
    I've recently switched from Windows XP Pro x32 to Windows 7 x64.  Now, one of my scripts that uses an ODBC connection will no longer work.  After a bit of searching, I discovered that Windows 7 x64 does not currently have 64bit Excel drivers.  However, you can set up 32-bit connections by running "C:\Windows\SysWOW64\odbcad32.exe".  Unfortunately, my script still won't work even though I set up the System DSN exactly like I did on my old computer.  When I run my script, I get the following error:
    Quote:
    Script:  X\XML_Check.vbs
    Line:  212
    Char:  3
    Error:  [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.
    Code:  80004005
    Source:  Microsoft OLE DB Provider for ODBC Drivers
    Line 212 contains:
    objConnection.Open "DSN=charge_codes_XLS;"
    It seemed to me that wscript.exe will only communicate properly with an identical environment (x32 to x32 or x64 to x64, but not x64 to x32 or x32 to x64).  With that in mind, I found a way around the error by running my script via the 32bit version of Windows Script Host.  I changed the shortcut path from "X:\XML_CHECK.vbs" to "C:\Windows\SysWOW64\wscript.exe X:\XML_CHECK.vbs" and the script appears to function ok. 
    What I really want to know is if there is a way to run my script via the 64bit version of wscript.exe yet have it connect to the 32bit ODBC subsystem? Is there a specific connection string I can use or am I just out of luck until Microsoft puts out 64bit Excel drivers?

    I faced the same issue recently. There was a 32bit MSOffice installed on the 64bit server and the same visual basic code worked from MS Office script debugger, and did not in the cscript/wscript.
    It seems that 
      - the  cscript/wscript used 64bit ODBC driver
      - the  office used     32bit ODBC driver
    Excel drivers are installed for 32bit ODBC (because of 32 bit office the ODBC manager 32bit was a full hand of drivers).
    Excel drivers are NOT installed for 64bit ODBC manager (because of 32 bit OFFICE) and can not be installed while the 32bit MS OFFICE is installed.
    The SQL drivers are installed for 64bit ODBC (so that is why the SQL connection was established well)
    The solution would be to run .js .vbs scripts in 32 bit environment:
    \windows\SysWOW64\cscript.exe or \windows\SysWOW64\wscript.exe 
    Search for more with: how do i run a vbscript in 32 bit mode on a 64 bit machine

  • How SAP BW system read cube data?? - Important

    Hi BW and database level gurus
    I have very simple question . I want to know how SAP BW system read data from the cube.
    If I write a simple BEx query and execute - how does system gets data from cube?
    Here is what I wish to know -
    1) Does it use SELECT statement after all to get data based on set of SID or DIM ids?
    2) What is the backend data retrieval architecture look like . Can someone provide me some digram to explain ?
    3) Data in cube is stored in ROLAP concept so then will I get same performance if I had simple transparent table? why should we use CUBE then?
    4) What are the steps that happens in backend ABAP that get us the expected result?
    Thanks and I will appreciate your reply
    AG
    Edited by: AM on Apr 10, 2008 2:48 AM

    Hi,
    Yes, it uses select statements to fetch data. It initially makes selection from the dimension tables for the necessary characteristics and then gets the corresponding key figures from the fact table.
    say for example, to fetch the top sales vales and customers from a region say India. Then, the select statement will make all customers from customer dimension belongining to the region India from the region dimension and finally gets the corresponding values from the fact table.
    If you use simple table, OLAP concept cannot be applied, and the way the master data is retirved for the corresponding transaction data is far more efficient in olap.
    Thanks

  • How to read a client's File system

    Hi,
    I use a web application where in the client can upload a directory to the server. Then the server should display all the files under that directory by fetching details from the client's disk.
    how should this b done with java? Java file system does not allow this. If contents of a single file needs to be read, then it can be sent as multipart form data.
    How to read or find out the files under a directory on the client machine?
    Thnx in advance

    It can be done using the File class used in Java. It can list out directories .
    Several methods are available for inspecting an instance of the File class. Some of the important ones are:
    Method                                                                                             Purpose
    boolean exists()                                   does the file exist?
    boolean isFile()                                    is it a file?
    boolean isDirectory()                            � or a directory?
    String[] list()                                       return the names of all files and directories in a directory
    String getName()                                get the file or directory's name
    String getPath()                                  get the file or directory's path
    These methods are actually all we need in order to find all files and directories in a given directory--all the way down to the last leaves in the directory tree.

Maybe you are looking for