Registering db's with ODBC through Java code?

Hey, I have a project which uses an msacces database, I first have to register the database with odbc in windows, but I wonder if you can't do this with Java code instead of letting to user do some things he'd probably screw up while deploying the app.

nope, no api. You will need to JNI to native C++ code to effect things like ODBC setup, registry, and paths, etc. There are third party apps, $$, that you can find on google.com

Similar Messages

  • Problem with executing shell script on linux through java code.

    i am facing problem to kill jboss process on linux that is my application requirement. for that i created one shell script that will get all the process for jboss instance and kill them when i am running that script from command prompt on linux its working perfectly.
    The command i am using ---
    /opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh.
    but when i am running through java code its not working.
    the java code i am using is:-
    pp = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "/opt/RW9/jboss/v4.0.5.GA/bin/restartjboss.sh"});
    could anyone tell me what is the problem ?
    Edited by: akm198110 on Sep 2, 2008 9:24 AM

    I got the problem after long struggle ,after doing proper path i am able to execute the shell script..

  • How to Increase Java Heap Size through Java Code. Increase inside Code?

    Hi All,
    I am using a third party tool. When i run a particular program it says OutOfMemory error. I like to increase heap size through Java Code before calling the particular Java application or Code..
    Is there is any way to set the Heap Size through Java Code in run time ???
    Pls Kindly help.
    Thanks.

    if you start the program with a -Xmx512m flag, the virtual machine gets half a gigabyte of memory to use (or that's the max it's allowed to use). All things run in the same virtual machine will have the same limit, third party tools run in the same virtual machine can't "not care about this" unless they're throwing OOMs themselves for some stupid reason.

  • Getting problem when connecting to SMTP server through java code

    Hi all,
    I am getting problem when i am going to connect with "Kerio SMTP server" through java code. The error what i am getting is :
    "[16/Sep/2008 15:59:09] Sent: Queue-ID: 48cf8a73-000000f9, Recipient: <[email protected]>, Result: failed, Status: 5.3.2 554 5.0.0 Too many hops (101, max 100), message looping" when sending an email from [email protected]

    Looks like something is set up wrong on your server that's causing messages
    to be forwarded around a loop too many times without ever reaching the destination.
    For instance, if server A forwards to server B, and server B forwards to server A,
    this would happen.

  • Running windows command through java code

    Hello
    i want to execute jar.exe through java code , i have written following piece of code , but it isn't working
    ProcessBuilder processBuilder = new ProcessBuilder(new String[]{"cmd.exe","/c","%java_home%\\bin\\jar.exe"});
              Process process = processBuilder.start();
              BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
              String line = inputReader.readLine();
              while(line != null){
                   System.out.println(line);
                   line = inputReader.readLine();
    does anybody knows why
    Regards
    Edited by: Mayur Mitkari on Mar 5, 2013 10:19 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM
    Edited by: Mayur Mitkari on Mar 5, 2013 10:20 PM

    sorry for that , but the
    Runtime runtime = Runtime.getRuntime();
              Process proc = runtime.exec(new String[]{"cmd.exe","/c","jar"});
              proc.waitFor();
    int i = proc.exitValue();
    this code was different from first one
    and in case of Process if runtime .exec is succesful it is wainting for long time , in this case i want if the runtime.exec is succesful something should be returned
    Regards

  • Adding rows to J2ME WTK/Settings/User Defined (through Java code)

    Hi all..
    Just a quick question..
    Is it possible to add Key/Value pairs to a MIDlet's 'User Defined' field through Java code..(ie) - add a new row to the User Defined field..
    If not, can anyone tell me how a Bluetooth-Client GUI can save an image it has been sent by a Bluetooth-Server GUI?
    Thanks in advance..
    Rookie

    if i understand you, you want to call application module method when user clicks on add button on the UI and your table is from VO
    so what i can come up for now is:
    1) create variable binding from the iterator for both name and price.
    2) on your UI action button :
    <af:commandButton actionListener="yourbean.addToCart">
    <f:attribute name="pName" value ="binding.<created name bind variable>"
    <f:attribute name="pPrice" value = "binding.<created price bind variable>"
    </af:commandButton>
    3) custom Managed Bean:
    //yourBean.java
    public void addToCart(ActionEvent e){
    // get binding here
    // use executeWitParams method to send parameter to the function "testMethod" and execute
    //AppModuleImp.java
    public void testMethod(String pName,String pPrice) {
    CardVOImpl vo = this.getCartVO1();
    CardVORowImpl r = (CardVORowImpl)vo.createRow();
    r.setAttribute("NAME", pName);
    r.setAttribute("PRICE", pPrice);
    vo.insertRow(r);
    Hope this helps...
    Let me know if not..
    Thanks
    Edited by: MavenDev on Oct 30, 2011 8:08 PM

  • How do I trigger an Oracle report through Java Code?

    Hello,
    I am new to reports. Is there any way to trigger a report through java code - I know there is an OS command to trigger a report automatically. Has anybody done this through a high level PL?
    Amit

    We are in a similar situation. If you receive any answers can you forward the same to [email protected]

  • How to find IP allocated to windows OS through java code

    Hi,
    I want to find no of IPs allocated to windows OS through java code. How i can do this.Please give me idea.
    any help will be appricated.
    Thanks in advance
    Ravi Adha

    You can use the InetAddress class in the java.net package to find all the IP addresses of your computer.

  • Need to track windows processes through java code.

    Need to track windows processes through java code.
    Eg: I want to find out whether an exe file (wrun.exe) is running or stopped.
    Can I do it through java. If so can any one please tell me how to do it. That will be a great help.
    Thanks,
    Ramesh

    There are 2 options for things like this:
    1) Use Runtime.exec() to execute some command or application and parse the input from it.
    2) Write some native code and use JNI to call it.

  • Setting java_home through java code

    Hello , i went through lots of information for setting java_home through java code but i was unable to find any useful information, does anybody know how to set java home through java code
    Regards
    Mayur Mitkari

    The question doesn't make any sense to me. If Java needs the JAVA_HOME variable set, how is it ever going to execute any code that does so? And if it doesn't need it, why set it?

  • Opening a word file in MS Office Word software window through Java code

    I want to open a word file in MS Office Word software window through Java code.
    Is it possible ? If possible then please let me now how can I do it.
    Bhoopender

    Thanks for replying.
    I tried the following code -
    public class OpenFileWithItsExt
         public static void main(String[] args) throws java.io.IOException
              Runtime.getRuntime().exec("a.doc");
    and it gets compiled successfully, but on running outputs as -
    Exception in thread "main" java.io.IOException: CreateProcess: a.doc error=193
    at java.lang.Win32Process.create(Native Method)
    at java.lang.Win32Process.<init>(Win32Process.java:66)
    at java.lang.Runtime.execInternal(Native Method)
    at java.lang.Runtime.exec(Runtime.java:566)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:364)
    at java.lang.Runtime.exec(Runtime.java:326)
    at OpenFileWithItsExt.main(OpenFileWithItsExt.java:5)
    My file is in the pesent working directoty.
    Please solve my problem.
    Thanks

  • Change the Summary Attribute Value through Java code

    Hi ,
    I am working on a requirement where I need to set the Attribute value on the final Summary Screen through Java Code.
    Code :
            InterviewUserData data = new InterviewUserData();
            InterviewEntityInstance globalInstance = data.getGlobalInstance();
            globalInstance.setValue("Name", value_to_set);
    On completion of the interview session Name is displaying as NULL.
    I need to set NAME = value_to_set and display it on the final summary screen.
    Any help on this will be appreciated.
    Regards

    The InterviewUserData object is effectively a change set, to apply this to a session you use the InterviewSession.submit(InterviewUserData) method. You don't say how you are invoking this code but if it's inside an event Interview Engine handler the InterviewSession object should be accessible.
    Regards
    Ian

  • How to update OID oblogintrycout attribute through java code

    Hi Team,
    As per my requirement ,i need to update OID oblogintrycout attribute through java code. could you please help me on this.
    where can i get the java code.
    Regards,
    Ravi.

    As always, Google is your friend.
    Follow the bouncing link.
    http://www.google.com/search?hl=en&q=VisualSourceSafe+%2B+Java+API
    PS.

  • Passing parameters to Widgets through Java code

    hi,
    i want to pass parameters to yahoo widgets through java code. Eg, if we consider yahoo weather widget, then i have to pass the parameters country through java code. i also have to read the output given by widget through java code (which in this case is the weather for all the days for the current week).
    This is an extremely urgent requirement, so quick and helpful reply will be highly appretiated.
    thanks in advance

    Hello,
    Did you try passing through the URL
    eg: http:
    test.html?a="test"; and use some request open to get the values from the url.
    HTH
    Vivek Nidhi

  • Importing data from ms access to db2 through java code

    hi there,
    i want to develop a code in which i can set ODBC settings because i dont want user to manually set these settings using administration tools in control panel.....is there any way of doing this.?
    but my main problem is , importing database from .mdb file to db2 using java code only.....
    thanks in advance

    one point i want to mention here...there is perhaps a 'cursor problem' ( or not a problem at all )...see the following code...
    1. while (res.next()) {
    2. System.out.println("-> " + res.getString(2));
    3. jTextArea1.append("-> " + res.getString(2) + "\n");
    4. }
    You have a repetition problem.
    Cursors are like iterators: you can't reuse them. Once you iterate through them you have to reinitialize them. Some JDBC implementations are picky about the order in which you access variables. This one appears to not allow you to access them twice.
    The question is: why do you bother to get this value twice? Just do it once, like this:
    while (res.next())
       String str = res.getString(2);
       System.out.println("-> " + str);
        jTextArea1.append("-> " + str + "\n");
    }Another question worth asking: Why is UI code mingled in with database code? Poor layering. I hate seeing Swing and JDBC mixed together like this.
    %

Maybe you are looking for

  • Where is the "month" view on the calendar in iOS7?

    The subject is my question. What happened to the month view on the calendar in iOS7? I really liked my MONTH view. Mine is showing only 3 options: Today, Calendars, Inbox. I really liked being able to see what is scheduled for the month.  Now I have

  • Show Time only in inputDate component

    Hi, I have a requirement to show Time only field, and later update this Time to the a Date field in the database with this time portion only. I used the convertDateTime on the inputDate as follows: <af:inputDate label="Start Date" id="id1" required="

  • Why iWork isn't for free?

    I have already look at the keynote from apple.com. Their it say iwork is free but when I look at App Store, you still have to pay. I don't know what happen

  • Why Does My Apple Time Capsule , not share ethernet when connected to my current network?

    Hello Thank You for taking the time to look at this , my apple time capsule will not share ethernet when joined to my current network , the only way i can get the ethernet ports working is connecting a ethernet port from my airport express to my time

  • Does my Pc carry UEFI?

    Hello, I carry a HP Pavilion P6110f, modified with a Nvidia GeForce GT 730. I was trying to install SteamOS, and I keep getting the dreaded No command error. Does my BIOS Carry UEFI, the thing required to boot up SteamOS? UPDATE: BIOS version is Amer