Using Two different drivers  simultaneously

I want to use two different type 4 drivers i.e. one driver of ms-access and one of ms-sql server 7 simultanoeously in one java program.please tell me how can i do this ?

i need to load two drivers for my java program. i need to connect to oracle database and count the no of rows and then connect to sql database and count number of rows.print them on command prompt.
can someone simplify this code??
package connectDatabase;
* @author
import java.sql.*;
public class ConnectTo
     public void OracleDB()
          Connection dbconn;
          try {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            String connString="jdbc:oracle:thin:@SYS_IP:1521:oracl";
            dbconn = DriverManager.getConnection(connString, "uname","pwd" );
        catch(SQLException sqlex)
             sqlex.printStackTrace();
        catch(Exception excp)
            excp.printStackTrace();
     public void SqlDB()
          Connection conn;
          try { 
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
            String url = "jdbc:odbc:connectDB"; 
            conn = DriverManager.getConnection(url,"uname","pwd");  
          catch (Exception e)
            System.err.println("An Exception occured! " +e.getMessage()); 
}

Similar Messages

  • HT204053 Two different accounts simultaneously on my apple tv?

    Can I use two different accounts simultaneously on my apple tv? (one for iCloud and one for iTunes store)

    Welcome to the Apple Community.
    If you mean for redownloading content such as TV shows etc, then no because this is controlled by your store settings.

  • Using Berkeley With Two Different Environment Simultaneously

    I am trying to use Berkeley with two different environment simultaneously in one program. But I am getting an error message of Databases left open. The first environment close with no error but the 2nd environment, having an error like this,
    Exception in thread "main" java.lang.IllegalStateException: Unclosed Database: element_primary_key_index\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
    Unclosed Database: class_catalog\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
    Unclosed Database: element_database\\192.168.150.211\glassfish3\Berkeley\environment\Testing11
    Databases left open: 3
         at com.sleepycat.je.Environment.close(Environment.java:383)
         at com.svi.tools.gfs3v10domain.database.GFS3v10ReadWriteDatabase.closeUpload(GFS3v10ReadWriteDatabase.java:155)
         at com.svi.tools.gfs3v10domain.GFS3v10Domain.closeReadWrite(GFS3v10Domain.java:160)
         at com.svi.tools.gfs3v10.util.GFS3v10UploadUtil.closeUpload(GFS3v10UploadUtil.java:97)
         at com.svi.tools.gfs3v10.GFS3v10.closeUpload(GFS3v10.java:115)
         at com.svi.tools.gfs3v10uploader.util.Uploader.uploadFiles(Uploader.java:89)
         at com.svi.tools.gfs3v10uploader.GFS3v10Uploader.mainMethod(GFS3v10Uploader.java:109)
         at com.svi.tools.gfs3v10uploader.GFS3v10Uploader.main(GFS3v10Uploader.java:52)
    Please someone help me with my problem. Thanks in advance.

    Hi Mark,
    Here is my sample program for the problem:
    import java.io.File;
    import com.sleepycat.bind.serial.StoredClassCatalog;
    import com.sleepycat.je.Database;
    import com.sleepycat.je.DatabaseConfig;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.je.EnvironmentLockedException;
    import com.sleepycat.je.SecondaryConfig;
    import com.svi.tools.gfs3v10domain.objects.GFS3v10DomainElementData;
    import com.svi.tools.gfs3v10domain.objects.GFS3v10DomainElementKey;
    import com.svi.tools.gfs3v10domain.views.utils.ElementByPrimaryKeyCreator;
    * Read Write Database used for every thing else.
    public class MethodsSample implements GFS3v10Database {
         * Environment where the Database resides.
         private Environment environment = null;
         private boolean isClose = false;
         String environmentString;
         * Class Catalog for Stored Classes.
         private static StoredClassCatalog classCatalog;
         * Element Database.
         private static Database elementDatabase;
         * Element Database by Primary Key.
         private static Database elementByPrimaryKeyDatabase;
         private static Database catalogDatabase;
         * Default Constructor.
         public MethodsSample() {
    * Alternate Constructor.
    * @param homeDirectory Location where the Database is Located.
    public MethodsSample(String homeDirectory) {
         environmentString = homeDirectory;
         openEnvironment(homeDirectory);
         openDatabase();
    @Override
         * Opens the Read Write Database.
         * @param homeDirectory Location where the Database is Located.
    public void openEnvironment(String homeDirectory) {
         EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setTransactional(true);
    environmentConfig.setAllowCreate(true);
    environmentConfig.setDurability(DURABILITY);
    while (environment == null) {
         try {
              environment = new Environment(new File(homeDirectory), environmentConfig);
         } catch(EnvironmentLockedException ele) {
              try {
                             Thread.sleep(500);
                        } catch (InterruptedException e) {
    @Override
         * Opens the Database.
    public void openDatabase() {
         DatabaseConfig databaseConfig = new DatabaseConfig();
         databaseConfig.setDeferredWrite(true);
    databaseConfig.setAllowCreate(true);
    catalogDatabase = environment.openDatabase(null, CLASS_CATALOG + environmentString, databaseConfig);
    classCatalog = new StoredClassCatalog(catalogDatabase);
    elementDatabase = environment.openDatabase(null, ELEMENT_DATABASE + environmentString, databaseConfig);
    SecondaryConfig secondaryConfig = new SecondaryConfig();
    secondaryConfig.setDeferredWrite(true);
    secondaryConfig.setAllowCreate(true);
    secondaryConfig.setSortedDuplicates(true);
    secondaryConfig.setKeyCreator(new ElementByPrimaryKeyCreator(classCatalog, GFS3v10DomainElementKey.class, GFS3v10DomainElementData.class, String.class));
    elementByPrimaryKeyDatabase = environment.openSecondaryDatabase(null, ELEMENT_PRIMARY_KEY_INDEX + environmentString, elementDatabase, secondaryConfig);
    @Override
         * Gets the Environment.
         * @return Environment.
    public Environment getEnvironment() {
         return environment;
    @Override
         * Gets the Class Catalog.
         * @return Class Catalog.
    public StoredClassCatalog getClassCatalog() {
         return classCatalog;
    @Override
         * Gets Element Database.
         * @return Element Database.
    public Database getElementDatabase() {
         return elementDatabase;
    @Override
         * Gets Element By Primary Key Database.
         * @return Element By Primary Key Database.
    public Database getElementByPrimaryKeyDatabase() {
         return elementByPrimaryKeyDatabase;
    @Override
         * Closes Database and then Environment.
    public void closeUpload() {
         System.out.println("1st Jar environment closing = " + environmentString);
         elementByPrimaryKeyDatabase.close();
         elementDatabase.close();
         classCatalog.close();
         catalogDatabase.close();
         environment.close();
         isClose = true;
    public Boolean isClose() {
         return isClose;
         @Override
         public void closeOthers() {
    for the Main:
    public class sample {
         public static void main(String[] args) {
              String environment1 = "\\\\192.168.160.184\\glassfish\\berkeley\\environment\\home\\Multiple\\Testing11";
              String environment2 = "\\\\192.168.150.211\\glassfish3\\Berkeley\\environment\\Testing11";
              openCloseEnvironment(environment1, environment2);
         public static void openCloseEnvironment(String environment1, String environment2) {
              MethodsSample forEnvironment1 = new MethodsSample(environment1); //Opens the Databases
              MethodsSample forEnvironment2 = new MethodsSample(environment2); //Opens the Databases
              forEnvironment1.closeUpload();
              forEnvironment2.closeUpload();
    // same error happens no matter what sequence for closing
    Thank you.

  • How to use two different versions of Firefox at the same time on Snow Leopard?

    I recently upgraded to Firefox 4.0 on my 27" iMac running Snow Leopard 10.6.7.
    Previously, I was using Google's "Page Speed" along with Firebug in Firefox 3.6.15 to optimize images in my web pages, and to find other areas to optimize.
    Page Speed is not yet compatible with Firefox 4.0. I wrote to Google about this some time ago -- no answer yet.
    If I run Firefox 3.6.15 in order to use Page Speed, I run into a few problems afterward when I start using Firefox 4.0 again, since they both use the same "Firefox" folder in my "Application Support" folder.
    How can I set it up so that I can have two separate "Firefox" folders in my "Application Support" folder?
    Or is there an easier way to use two different versions of Firefox simultaneously, even if one has extensions and/or plug-ins installed which are not compatible with the other version?
    Thanks for a great browser!

    Please disregard my question. I just conducted more web search and learned how to use Firefox's profile manager in order to make a separate profile for Firefox 3.6.15.
    You can find instructions on this page:
    http://support.mozilla.com/en-US/kb/Managing%20profiles#os=mac&browser=fx35
    '''A small tip:'''
    If your Firefox app is named anything other than "Firefox" -- say for example "Firefox 3.6.15" -- when you follow the instructions at the above link, make sure you escape the blank space that is before the version number by adding a backward slash before it, when you type the command string in the Terminal. In other words, in that string, you should use this:
    Firefox\ 3.6.15
    I hope that helps someone.
    WW

  • Using two different datasource driver into a transaction

    Hi all,
    i have two database : one under Informix and another under Oracle.
    Well, well, i have declared two datasources in my apllicationserver ( Sun ONE 7).
    I have to use a session EJB to write into the two databases some data and i have to open an UserTransaction to deal with it.
    The flow is :
    - open the UserTransaction
    - Get the connection from the first datasource
    - launch the INSERT query in Informix
    - Get the connection from the second datasource
    - launch the INSERT query in Oracle
    My doubt is : Will the transaction work fine even if i have to use two different connection from two different datasources ?
    Using only one database the transaction work fine.
    Cheers.
    Stefano

    Hi,
    This will work correctly if you use XA drivers (XADataSource instances).
    You can check the vendor docs to see what exact classes you need to deploy for each database.
    Beware of the pitfall: if you don't use XA drivers then commit might very well appear to work, but rollback won't.
    Also, don't forget to close the connections.
    Hope that helps,
    Guy
    Atomikos TransactionsJTA - visit our new JTA forum at http://www.atomikos-support.com

  • Is there any way to scroll two different documents simultaneously?

    Hi all, scroll two different documents simultaneously  - it will be helpul while doing corrections / checking documents. Is there any plugin available for this?

    I use two computers (don't laugh). I set up the laptop next to my desktop monitor and use one hand on each keyboard.
    Consider using (if appropriate) compare tools as well. You can export both documents to RTF and use Word to compare them if all you care about is textual differences. You can export both documents to PDF and use Acrobat to compare them if you need to see graphic differences as well.
    Ken

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • Use two different printer services in one web template?

    Hi!
    Is it possible to use two different help services for printing in the same web template (for the same table item)?
    Print1:
    <param name="HELP_SERVICE" value="HELP_SERVICE_PRINT"/>
    <param name="HELP_SERVICE_CLASS" value="ZCL_RSR_XLS_HELP_WINDOW_PRINT"/>
    Print 2:
    <param name="HELP_SERVICE" value="ZPRINTING"/>
    <param name="HELP_SERVICE_CLASS" value="ZBW_PRINT_HELP_SERVICE"/>
    I was thinking that you maybe could change the param name values for the "Help_service" and the "help_service_class" at runtime using the properties for the table item, so that you could choose which one to use, but I havne't been able to do that so far.
    Does anyone have an idea?

    This is not a problem. Just put the print service for the print to excel on an object other than the table web item. As long as these print services exist on any web item, you should be able to invoke them. I've tested this with putting the "Print with Excel" service on the Navigation Block Web Item and the other print service on the table web item. Hope that helps!
    Prakash

  • How to use two different network cards on RT?

    Hi everyone... I'm currently working on a project where I have to deal with the issue mentioned in the thread's topic: I have a PC with RT LabVIEW that has to be able to establish network connections using two different network cards. One will be used to connect via TCP/IP with a host computer that will show the data transmitted through shared variables; the other will communicate with another PC through Modbus protocol. The key is that each communication is done through a separate network card.
    So far I haven't been able to figure out how to configure both things to happen. Does anyone know how to do this? Any tips will help.
    For the RT communication I'm using a standard RT project, with the RT PC being given one of the IPs, and for the Modbus part, I created an I/O server with a master and a slave. Separately everything works fine, but when I get them together it simply won't work.
    Thanks for your help!
    Solved!
    Go to Solution.

    Sorry it took me so long to answer, I've been busy lately....I've found a solution to the problem I mentioned, and just in case anyone has similar problems in the future, I'll shortly describe what happened.
    As Caseyw suggested, it was necessary to enable both network cards through the Measurement and Automation Explorer. The cause of the connections malfunction was actually that I wasn't using the "right" protocol for the Modbus communication, which ran on the secondary adapter. The solution was to use the URL protocol with the correct path on the field, addressing the right IP address. To avoid making this post a mixture of topics, I won't elaborate futher, but I got the gist of it, so if anyone is having similar problems whether it is working with several network cards or with Modbus communication protocols, feel free to contact me, I'll be glad to help.
    Thanks

  • SBO - How to use two different Stock Account within the same Item Group

    Hi,
    I'm currently stuck within one of my implementation.
    I'm deploying the same solution worldwide which worked pretty well until now. All the items are connected to an item group, with a unique GL account, supposed to book at the same time the good receipt and the good issue (Balance-Sheet Account = 14xxxxx).
    My new unit is willing to use two different GL accounts when performing its stock entry (let say 14xxx10) and another GL account for the good issue, let say 14xxx20.
    Do you have any clue so i can please them and keep using at the same time the item group ?
    Thanking you in advance
    Stephane

    Hi,
    In fact, we use the GL account as the HQ Account (Reporting Account) while the "Export Code" will be used to store the local GL Account (greek account).
    As such, we can, somehow handle two different chart of accounts.
    In my reporting, i'm only using a single GL account for stock movements, while my greek counterparts want to handle two different accounts.
    Threfore, i have only two solution since there is normally a one to one relationship between a HQ account and a local account that are :
    1 - Duplicate the HQ accounts
    In that case, i do respect anytime the one to one relationship. I've got one HQ account for one local account. But how can i put this since i can only handle one single stock account.
    2 - I keep my single stock account like this but i won't be managing the possibility to get two different Export Codes.
    Regards
    Stephane

  • Can you use two different apple ID's on one Ipad?

    I would like to use two different apple id's on one IPAD.  One apple ID is for work and the other is for personal use.

    Read this.
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/ht4627
     Cheers, Tom

  • HT204053 If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    If I have set up my Mac with two different users,  can I use two different Apple IDs on the same Mac?

    Each user account may have its own Apple ID.

  • Can I use two different devices with different apple ID for backing up data on one machine without losing any data that was backed up with one device earlier?

    Can I use two different devices with different apple ID for backing up data on one machine without losing any data that was backed up with one device earlier?

    The link is to a discussion started on 12/18 in the FiOS Internet forum.  Here's the link I get now, however it is different than the link I pulled a few hours ago.  If this system changes the link again, it may not work.
    http://forums.verizon.com/t5/FiOS-Internet/Frustration-and-just-confused-with-internet-help-please/t...
    You can also look for the topic, "frustration and just confused" in the FiOS Internet forum.
    Here's a link that is in the thread that gives more detail.
    https://secure.dslreports.com/faq/15984
    Good Luck!
    P.S.  "Copper Contributor" is my "rank."  gs0b is my user name.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.

  • Can I use two different itune accounts on one computer?

    Can I use two different itune accounts on one computer?

    1. Give her a separate user account on your computer. If you have a backup copy of the library, you can restore it.
    2. If you encounter a 90-day waiting period, click here and ask the iTunes Store staff if they'll remove it.
    (125941)

  • Is there any way to switch between using two different phones?

    I know when phones have SIM cards (like with ATT), you can use two different phones by simply moving the SIM card from one phone to the other and ATT is none the wiser.
    Is there any way to do that sort of thing with Verizon?
    I currently have an iPhone 5 but would like to start playing around with Android (I'm a gadget nut).  So, assuming I find an unlocked Android phone, is there any way to bounce back and forth between using different phones (obviously only one at a time)?

    Michael_F wrote:
    So, the SIM card contains all the info necessary for the new phone to ring when called, etc?
    yes, assuming the phones use the same size SIM card (otherwise, you'll need an adapter or a new SIM card; the cards are free at your local Corporate Verizon store).
    4G SIM Information | Verizon Wireless

Maybe you are looking for

  • Oracle Financials 11.0

    I am interest in discovering all available APIs that can be invoked by external applications to post data to the Oracle Apps tables. For example, the Oracle Receivables Transaction API can be used to import invoices, credit memos, and debit memos int

  • I want to share a DVD from my IMAC to MACBOOK AIR. any Suggestions

    I am trying to share a DVD from my IMAC to my MACBOOK air. Any suggestions?

  • PR workflow for item level release (stock and non-stock)

    Hello gurus, I am not getting the agents.!! I am creating a workflow for pr( item level release)..and using standard wf WS00000038 for this, as the standard wf contains the simple release procedure  only but i have to add some custom steps to it, so

  • Can you bring an existing website into WebTools?

    My customer has a website already that would just need a few bits tweaking if he could bring it into WebTools.  Is this possilbe?  Has anyone done it already? Kind Regards Jan

  • Using REST-based data in SolMan

    Hi, In the [Apache Project ESME|http://incubator.apache.org/esme], we have made JMX-based data available via a REST interface. This is partially related to restrictions that are present in many cloud-based environments.  We are looking to see how exi