Dynamic JDBC URL in JClient-Application

I want to switch between test and production database at login.
I added JTextFields for the database server and sid in the default JCLoginDialog and set the parameters Configuration.DB_USERNAME_PROPERTY and Configuration.DB_PASSWORD_PROPERTY in the method getInfo, this works.
But when I set the parameter Configuration.DB_CONNECTION_PROPERTY with the jdbc url, this was ignored.
Is this the wrong way to switch between database connections?

I want to switch between test and production database at login.
I added JTextFields for the database server and sid in the default JCLoginDialog and set the parameters Configuration.DB_USERNAME_PROPERTY and Configuration.DB_PASSWORD_PROPERTY in the method getInfo, this works.
But when I set the parameter Configuration.DB_CONNECTION_PROPERTY with the jdbc url, this was ignored.
Is this the wrong way to switch between database connections?

Similar Messages

  • Dynamic JDBC URls at Runtime

    Hi Experts,
    I did my application in jdev 11.1.1.6 and deployed using Jdbc Url connections and it worked successfully (Actually I m working with 2 diff Database connectiosn in my application)
    But the thing is my company need me to do something like I should be able to dynamically use Jdbc url connections at runtime so that they want to have QA db and PROD db inside the application
    and dynamically change them itseems. (i.e I will have 4 Db in which 2 for QA and 2 for PROD)
    Is there a way where I can achieve them. If so help me out.
    Thanks,
    933601

    Hi,
    You could store the database URLs in a properties file in the app server filesystem, then look them up in the dynamic JDBC code before setting the session attributes. So your QA app server has a properties file containing the URLs for the 2 QA databases and the PROD app server has a properties file containing the URLs for the 2 PROD databases.
    If you want a single app server to talk to multiple sets of databases you could pass a parameter to the login screen. Based on this you decide which database(s) to connect to.
    Kevin

  • JClient Dynamic JDBC Creadentials

    Hi!
    I need to implement solution described in article "How To Support Dynamic JDBC Credentials" in JClient application. As I understand, the only thing I need is to create my own class MyEnvInfoProvider and use it in JClient code.
    When I run application in local configuration, it works perfectly. But when I tried deploy it to Standalone OC4J - exception appears: Error while opening JDBC connection and SQL Exception invalid arguments in call.
    It seems that class MyEnvInfoProvider is not being using.
    Any ideas? Thanks.

    Alex,
    this was discussed in
    "To the JDeveloper Team "
    Re: To the JDeveloper Team (reposting again and again and again)
    "Dynamic JDBC Credentials "
    Dynamic JDBC Credentials
    " Disonnecting an application module from the database"
    Re: Disonnecting an application module from the database
    maybe you find the solution there
    Frrank

  • REDIRECT JDBC URL WHEN USING DYNAMIC JDBC CREDENTIALS SO NOT HARDCODED

    I have taken over an application that uses row-level security and ADF (using
    dynamic JDBC Credentials). I have been able to set the internal_connection to
    a JDBCDatasource, but cannot set the Connection Type in the Oracle Business
    Component Configuration to a JDBCDatasource. When I do, I receive errors that
    tables are not found. When I set the value back to a JDBC URL, everything
    works fine again.
    I am looking for a solution where the userid and password are not hardcoded in
    the BC4J.xcfg or a way to redirect this information, as we change our system
    passwords every nighty days. Otherwise, I will have to redeploy the
    application every nighty days.
    I did not create this application, but I am sure that you could simply follow
    the "How to Support Dynamic JDBC Credentials" article. From that point, you
    will probably be where I am, where I have the internal_connection set to a
    JDBCDataSource and working properly, but cannot set the Connection Type to
    anything where the userid and password will not be hardcoded or cause failure.
    I wanted to let you know that I have
    found the updated How to Support Dynamic JDBC Credentials
    (http://www.oracle.com/technology/products/jdev/howtos/bc4j/howto_dynamic_jdbc.h
    tml) and was going to run through the "Advanced: Supporting Dynamic JDBC URLs",
    but once I was done keying in
    env.remove(ConnectionStrategy.DB_CONNECT_STRING_PROPERTY); I received a
    depreciation message on the DB_CONNECT_STRING_PROPERTY. (Note: I am coding in
    JDeveloper 10.1.3, so this may be depreciated as of then, but the ADF Libraries
    for JDeveloper 10.1.3 are on our Oracle 10gAS 10.1.2 server.)
    I thought maybe this would resolve my issue, but I can't be sure as the
    deprecation message leads me to believe that this solution may not be viable in
    the future.
    UPDATE
    =======
    The article you are referencing is definitely an older version.
    There is a newer article for 10g at:
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
    Please see if that helps.
    I have already reviewed this article.
    In fact, I have reviewed many versions of this document. I have not seen one
    created yet for 10.1.3 though (especially without JSF as our 10.1.2 AS server
    will not support it). I need to find an example or documentation that shows
    how we can keep from having the JDBC URL stored in the BC4J.xcfg or a way to
    use dynamic JDBC credentials with a JDBCDataSource. We do not want to store
    the userid and password in the application, rather, we would like to setup
    something that can be configurable from the application server.
    I think we need to use the dynamic JDBC credentials because we are using the
    row-level security, where we setup a database context for the user and only
    allow certain records of a database table to be returned to the browser based
    on that context.
    Might there be a way to still use the JDBCDataSource?

    I understand that the user provides the userid and password and that these values are setup using the Configuration class.
    However, when I am to deploy the ADF Business Module with my application, I have to specify either a JDBC URL or a JDBC DataSource in the Oracle Business Component Configuration.
    When I use JDBC DataSource, the code does not work properly, almost like the user's credentials are not used for the connection (I get errors like table or view does not exist).
    When I use the JDBC URL, the bc4j.xcfg stores a reference in the JDBCName attribute to a ConnectionDefinition in the same file. It is in this tag of the bc4j.xcfg where the userid, sid, and password (encrypted) is stored and used when retrieving the initial context of the ADF business components.
    It is these values that I want to have stored else where so that the application does not have to be redeployed in order for the password (or sid, or other connection information) to be change.

  • Dynamic JDBC with JHeadstart

    Hi I have a problem using jheadstart when appliying dynamic jdbc credentials. I dont know why but my login page comes with errors . the picture of components does not come . for example the submit button comes with no picture but a cross sign (which happens when the picture is not found) and it is same for the other components.
    When I remove
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    from web.xml then they come but this time other pages are not found in navigation.
    What should I do?
    Certainly JHeadstart does override some parameters and this effects my pages. during start up. But I dont know why. You know what is so difficult about these frameworks. You have no knowledge of the underlying mechanism and when a problem occurs you can not figure out its reason . Actually I am complaning that you must write a book about JHeadstart with broader knowledge for users, guys. Without enough documentation you can not make people use it. So just think about it and please help me with my problem.
    expecting an answer soon
    write back quickly
    bye bye

    Hi,
    First, to reply to your remark about the JHeadstart team writing a book: we did! It's called the JHeadstart Developer's Guide and it's included in the JHeadstart release. Especially Chapter 5, JHeadstart Extensions to ADF Runtime, explains how the ADF Page Lifecycle works and how JHeadstart has extended that with extra functionality and how best practices have been implemented.
    Now to your problem with Dynamic JDBC: If the issue is related to the ADFBindingFilter, then it sounds like a generic JDeveloper/ADF problem, not JHeadstart specific. To simplify the test case, you could create a simple drag-and-drop ADF Application, apply the dynamic JDBC credentials to that application and see if the same problem occurs there. Then you can log a TAR at metaLink (http://metalink.oracle/com/), or ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html.
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Dynamic JDBC credentials example application from Steve Muench

    Apologies for this newbie question...but I'm trying to understand the Dynamic JDBC credentials example application from Steve Muench:
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#14
    I think I understand most of it but the one bit I dont understand is why it customizes the ADF Page Lifecycle (DynamicJDBCADFPhaseListener, DynamicJDBCPageLifecycle, DynamicJDBCPageLifecycleContext).
    Can anyone explain to an ex-forms developer why this code is there?
    I'm also trying to work out a way for the session to be invalidated when the user logins again
    e.g. a user logins, he doesnt use the logout function but uses the back button to go back to the login page. when he logs in with another set of credentials, would a new session start or as i supsect, it would use the original login credentials?
    Thanks

    You can ignore those three classes in the example. They are not related to the dynamic credential solution, and must have been left over from some other example I evolved into what you see. Sorry to have cluttered up the implementation with stuff that isn't really contributing to the actual solution. DOH!

  • Dynamic JDBC credential insert ERORR

    Hi,
    I have ADF-JCLient application where I implemented dynamic JDBC credentials. BUT There is a PROBLEM :
    I created a conection to the database ( in "Connections" Tab) for the schema user1.
    And I'm using the connection for my ApplicationModule.
    When I enter in the application as "user2" I can't insert in the views with the error :
    "JBO-26041: Failed to post data to database during "Insert": SQL Statement "INSERT INTO Table1(ID,USER_ID,PCTL_ID) VALUES (:1,:2,:3)"
    As you see because I'm "user2" I need to prefix the table name in the insert statement with "user1.Table1"
    in order for the insert statement to work.
    SO What is needed is to add the schema name in all statements send to database. This should be done at the view Level with a parameter "Schema_name".

    You can add the schema name in the EO dialog to the tablename. Just change MY_TABLE to MY_SCHEMA.MY_TABLE.
    But i am not sure if this propagates into your VO XML files.
    Otherwise you can create public synonyms in the database for all tables in your schema, but i would not recommend this because you can run into conflicts with oter applications running in your database.

  • Support Dynamic JDBC Credentials

    Can I use something similar in JDeveloper 11g like in this example http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html

    Here is the class
    package userinterface;
    import java.io.IOException;
    import java.lang.reflect.InvocationTargetException;
    import java.lang.reflect.Method;
    import java.util.Iterator;
    import java.util.Map;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.jsp.JspTagException;
    import oracle.adf.model.servlet.ADFBindingFilter;
    import oracle.adf.share.ADFContext;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.common.JBOClass;
    import oracle.jbo.common.ampool.ApplicationPoolException;
    public class DynamicJDBCBindingFilter extends ADFBindingFilter {
    public DynamicJDBCBindingFilter() {
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException,
    ServletException {
    HttpServletRequest svrRequest = (HttpServletRequest)request;
    HttpSession session = svrRequest.getSession(true);
    if (!isLoggedIn(session)) {
    if (!isLoginRequest(svrRequest)) {
    String method = svrRequest.getMethod();
    String requestUri = svrRequest.getRequestURI();
    if (method.equalsIgnoreCase("GET") &&
    requestUri.endsWith(loginPageRedirectName())) {
    super.doFilter(request, response, chain);
    } else {
    forwardToLoginPage(request, response);
    } else {
    try {
    String usrName = request.getParameter(USERNAME_PARAM);
    String pswd = request.getParameter(PASSWORD_PARAM);
    * If you need to support dynamically changing the JDBC URL
    * (for example to support changing which database instance
    * you are pointing at on the fly, then you need to change
    * the line of code below to assign a non-null value to the
    * jdbcURL variable. You would need to take the user-supplied
    * information and formulate a valid JDBC connection URL connection
    * string (without username and password) that looks like this:
    * jdbc:oracle:thin:@localhost:1521:ORCL
    * machine port SID
    * and then set this the jdbcURL variable to this value.
    String jdbcURL = "jdbc:oracle:thin:@10.3.3.68:1521:des10g";
    if (usrName == null || usrName.length() == 0 ||
    pswd == null || pswd.length() == 0) {
    throw new BlankUserNameOrPassword();
    session.setAttribute(Configuration.DB_USERNAME_PROPERTY,
    usrName);
    session.setAttribute(Configuration.DB_PASSWORD_PROPERTY,
    pswd);
    if (jdbcURL != null) {
    session.setAttribute(Configuration.DB_CONNECT_STRING_PROPERTY,
    jdbcURL);
    super.doFilter(request, response, chain);
    if (request.getAttribute(FAILED_ATTR) == null) {
    session.setAttribute(LOGGEDIN_ATTR, NON_NULL_VALUE);
    } catch (Exception e) {
    if (isFailedLoginException(e)) {
    signalFailedLoginAttempt(svrRequest);
    redirectToLoginPageOnLogonError(request, response);
    } else if (e instanceof ServletException) {
    throw (ServletException)e;
    } else {
    e.printStackTrace();
    throw new ServletException(e);
    } else {
    super.doFilter(request, response, chain);
    * Encapsulate detecting if the exception thrown
    * represents a failed login attempt.
    private boolean isFailedLoginException(Exception e) {
    * In 9.0.5.2, our eager AM acquisition will
    * cause the application pool exception to appear
    * without being wrapped.
    if (e instanceof ApplicationPoolException ||
    e instanceof BlankUserNameOrPassword) {
    return true;
    } else if (e instanceof ServletException) {
    Throwable rootCause = ((ServletException)e).getRootCause();
    * In 10.1.2 Struts, our lazy AM acquisition causes
    * the failed database login to be wrapped in a
    * ServletException that contains the ApplicationPoolException
    if (rootCause instanceof ApplicationPoolException) {
    return true;
    * In 10.1.2 JSP Model 1, our lazy AM acquisition causes
    * the failed database login to be wrapped in a
    * ServletException that contains a JspTagException.
    * The JspTagException does not wrap the original error,
    * but only encapsulate the original errors getMessage() value.
    if (rootCause instanceof JspTagException) {
    String errMsg = ((JspTagException)rootCause).getMessage();
    if (errMsg != null && errMsg.startsWith(APP_POOL_ERR_MSG)) {
    return true;
    return false;
    * Forwards control to the login page.
    private void forwardToLoginPage(ServletRequest request,
    ServletResponse response) throws ServletException,
    IOException {
    HttpServletResponse responseHttp = (HttpServletResponse)response;
    responseHttp.sendRedirect(loginPageRedirectName());
    markResponseCompleteIfUsingJSF();
    private void redirectToLoginPage(ServletRequest request,
    ServletResponse response) throws ServletException,
    IOException {
    HttpServletResponse responseHttp = (HttpServletResponse)response;
    responseHttp.sendRedirect(loginPageRedirectName());
    markResponseCompleteIfUsingJSF();
    private void redirectToLoginPageOnLogonError(ServletRequest request,
    ServletResponse response) throws ServletException,
    IOException {
    HttpServletResponse responseHttp = (HttpServletResponse)response;
    responseHttp.sendRedirect(loginPageRedirectName((HttpServletRequest)request) + "?failed=true");
    markResponseCompleteIfUsingJSF();
    * Signal a failed login attempt
    private void signalFailedLoginAttempt(HttpServletRequest request) {
    HttpSession session = request.getSession(true);
    session.setAttribute(LOGGEDIN_ATTR, null);
    request.setAttribute(FAILED_ATTR, NON_NULL_VALUE);
    session.invalidate();
    * If we are running in a Faces environment, invoke
    * the FacesContext.responseComplete() method after
    * the session invalidate. We use Java reflection
    * so that our code can still work in a Non-Faces
    * environment, too.
    private void markResponseCompleteIfUsingJSF() {
    try {
    Class c = JBOClass.forName("javax.faces.context.FacesContext");
    Method m = c.getMethod("getCurrentInstance", null);
    Object obj = m.invoke(null, null);
    m = c.getMethod("responseComplete",null);
    m.invoke(obj,null);
    } catch (InvocationTargetException ex) {
    throw new RuntimeException(ex);
    } catch (IllegalAccessException ex) {
    throw new RuntimeException(ex);
    } catch (NoSuchMethodException ex) {
    throw new RuntimeException(ex);
    } catch (ClassNotFoundException ex) {
    // Ignore, we're not running in a faces context.
    * Returns true if user is currently logged in
    private boolean isLoggedIn(HttpSession session) {
    return session.getAttribute(LOGGEDIN_ATTR) != null;
    * Returns true if the current request is a login request.
    private boolean isLoginRequest(HttpServletRequest request) {
    return request.getParameter(IS_LOGIN_PAGE_PARAM) != null &&
    request.getMethod().equalsIgnoreCase("POST");
    private static final String LOGIN_PAGE_REDIRECT_PARAM = "RedirectToLogin";
    private static final String FACES_URL_PATTERN_PARAM = "FacesURLPattern";
    private static final String LOGGEDIN_ATTR = "loggedin";
    private static final String FAILED_ATTR = "failed";
    private static final String USERNAME_PARAM = "form:username";
    private static final String PASSWORD_PARAM = "form:password";
    private static final String IS_LOGIN_PAGE_PARAM = "form:_loginpage";
    private static final String NON_NULL_VALUE = "x";
    private static final String APP_POOL_ERR_MSG = "JBO-30003";
    private static String loginPageRedirectName = null;
    private String facesURLPattern = null;
    private String loginPageRedirectName() {
    return loginPageRedirectName;
    private String loginPageRedirectName(HttpServletRequest request) {
    if (facesURLPattern != null) {
    if (request.getRequestURI().indexOf(facesURLPattern) == -1) {
    return facesURLPattern+loginPageRedirectName;
    return loginPageRedirectName;
    public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);
    loginPageRedirectName =
    filterConfig.getServletContext().getInitParameter(LOGIN_PAGE_REDIRECT_PARAM);
    facesURLPattern =
    filterConfig.getServletContext().getInitParameter(FACES_URL_PATTERN_PARAM);
    }

  • Questions about example "Dynamic JDBC Credentials for Model 1 and Model 2"

    Hello,
    i am trying to set up dynamic JDBC authentication in my ADF BC application - i want that it'll work like in Forms - a dababase user with the proper priveleges can log into my ADF BC application using his database login and password, and work with application.
    I've read the paper "How To Support Dynamic JDBC Credentials" at
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamicjdbchowto.html
    and test the very useful example, created by Steve Muench, which i've got from
    http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html#14
    The example works, but when i'm transfer its realisation in my application - it doesnt work the right way. The problems is the following:
    1. I can connect and work successfully only under the owner of the schema - the username and password of which i've wrote in the "jbo.server.internal_connection" string of the AM configuration.
    2. When i'm connecting under other users, which have all the rights to work with the db objects, used by application, i got the main page with the "Access Denied" message - as i have no priveleges to the tables.
    3. The big surprise is that if i am entering the fake username and password - the random letter combination - then i am getting the same behavior as in p.2 - the main page with the "Access Denied" message!
    And the last question is:
    4. Is it possible to set up the dynamic jdbc authentication using the build-in JDeveloper functions - i mean not to use that additional code, not override the ADF Binding Filter, and so on, but set up the similar behaviour (users log in using their db names and passwords) in several minutes following the standart documentation?
    Thanks in advance!

    One more question:
    I have 2 independent Application Modules in my application - to make the 2 transactions independent one form another, when working with different parts of project - and while using dinamic JDBC authentification, the user connects only in the first AM under the username he's entered, but the 2nd AM works under the predefined earlier (during development) connection for that AM.
    How can i make the 2nd AM to be connected under the logging in user (same as the 1rst AM)?

  • Creating a service ; What needs to be added to tnsnames.ora and JDBC url?

    DB version: 11.2.0.2
    OS platform : Solaris 10
    We have a 2 node RAC.
    DB name   = mbsprd
    Instance1  = mbsprd1
    Instance2  = mbsprd2I want Instance 1 (mbsprd1) to be used for our OLTP application and Instance 2 (mbsprd2) to be used for another application of DSS nature.
    Based on the syntax
    srvctl add service -d <dbname> -s <ServiceName> -r <Preferred Instance> -a <Available Instance>I am going to create 2 services
    -- Creating a service called OLTP
    srvctl add service -d mbsprd -s OLTP  -r mbsprd1 -a mbsprd2-- Creating a service called DSS
    srvctl add service -d mbsprd -s DSS  -r mbsprd2 -a mbsprd1-- Starting the services
    srvctl start service -d mbsprd -s OLTP
    srvctl start service -d mbsprd -s DSSI guess the above steps are enough to configure a service at the server side.
    I would like to know what needs to be done at the client side.
    Currently the tnsnames.ora file and JDBC url used by our clients are shown below. What needs to be added to tnsnames.ora file and jdbc URL to start using services configured above?
    -- SCAN based TNS entry
    mbsprd =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (COMMUNITY = tcp.world)
            (PROTOCOL = TCP)(Host = p148149-scan.tpam.net) (Port = 36964))
        (CONNECT_DATA =
          (SERVER       = DEDICATED)
          (SERVICE_NAME = mbsprd)
          (FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC))
    -- TNS entry based on local listener
    -- Instance 1
    mbsprd1 =
    (DESCRIPTION =
       (ADDRESS_LIST =
       (ADDRESS =(PROTOCOL = TCP)(HOST = hsolarp148-vip)(PORT = 36973))
       (CONNECT_DATA =
             (SERVICE_NAME = mbsprd)
             (INSTANCE_NAME = mbsprd1)
    -- Instance 2
    -- TNS entry based on local listener
    mbsprd2 =
    (DESCRIPTION =
       (ADDRESS_LIST =
       (ADDRESS =(PROTOCOL = TCP)(HOST = hsolarp149-vip)(PORT = 36973))
       (CONNECT_DATA =
             (SERVICE_NAME = mbsprd)
             (INSTANCE_NAME = mbsprd2)
    )JDBC entry for RAC
    jdbc:oracle:thin:@p148149-scan.tpam.net:36964:mbsprd -- Alternative version used by some clients because the above had 'some issues'
    jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=p148149-scan.tpam.net) (PORT=36964))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=mbsprd)(FAILOVER_MODE =(TYPE = SELECT)(METHOD = BASIC)(RETRIES = 180)(DELAY = 10))))

    OLTP =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = p148149-scan.tpam.net)(PORT = your_port_number))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = OLTP)
    DSS =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = p148149-scan.tpam.net)(PORT = your_port_number))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = DSS)
      )JDBC entry for RAC
    jdbc:oracle:thin:@p148149-scan.tpam.net:36964:service_name
    jdbc:oracle:thin:@new_tns_entry_description(if you would like to connect the database with particular service)
    try this and let us know any issues,

  • Strange problem with JDBC URL

    Hi All,
    I don't know whether this is a known issue which has a workaround or I am doing something wrong. But this is the problem.
    I have a nice GUI application which takes the JDBC URL, Driver, User name and password and then takes the input and tries to establish a connection with the Database. I was trying it on MySQL and I encountered a problem.
    The general format of the JDBC URL for MySQL is "jdbc:mysql://<ip_address>:<port>/<db_name> and if I have MySQL running on 3306 and if I give the URL as:
    "jdbc:mysql://localhost:9001" (where my HSQL is running), then, it never gets the connection and the application stays there forever (the call never returns after the DriverManager.getConnection() statement). And if I give the port as something else (say 9898) where nothing is running, then the getConnection() doesn't send me a SQLException.
    What could be the problem?

    Are you saying that you're connecting using the
    MySQL driver to an HSQL database, and
    that this results in a hang (rather than a timeout)?
    Just to clarify that I've understood the problem.
    If so, it should be fairly easy to get a simple test
    scenario up and running independent from your "real"
    application. Have you tried this, and could you post
    the code if so?
    Dave.Hi Dave,
    Thank you very much trying,
    Sorry if my English was poor. I am not trying to connect to HSQLDB using the MySQL Driver.
    Actually, I am trying to connect to MySQL db using the MySQL driver, but the DriverManager.getConnection() method hangs when I...
    1. Give a wrong URL e.g(jdbc:mysql://localhost:9001/")
    2. Run my MySQL on default port (3306)
    3. And If I have HSQL or any other program that is listening at port 9001.
    The problem seems to be very strange. here's the code below, you can try out yourself...
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class Demo {
         public static void main(String[] args) {
              try {
                   Class.forName("com.mysql.jdbc.Driver");
                   DriverManager.getConnection("jdbc:mysql://localhost:9001/", "user", "password"); // <-- The call hangs here
              } catch (SQLException e) {
                   e.printStackTrace();
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
    }Remember to have your mysql*.jar file in your classpath while running. :)
    Thank you....

  • JDBC URL or not JDBC URL

    Hello experts,
    I have two WLS 10.3.5.0 running in dev mode: WLS_A and WLS_B.
    They both have the same database resource, with the same name, and the same JNDI as well. Each WLS resides on a different Linux machine.
    If I set, in the Applictation properties in Jdeveloper, the database properties as JDBC Datasource, I can only deploy on WLS_A, while If I set the database properties as JDBC URL, I can only deploy on WLS_B.
    Why on hearth I get this different behavior, even if the WLS servers do have the same version, and the database is declared in the same way on both ?
    Is there any other setting on the WLS I'm missing ? I would like to have the same behavior for both server..
    Regards,
    Sergio.

    Yeah sorry, I try to give a more detailed explanation:
    - The deployment are in both cases successful, but I get for both server, in the log file - the one generated by startWebLogic.sh - the following warning message:
    <17.02.2012 07:21 Uhr MEZ> <Warning> <oracle.adf.share.jndi.ReferenceStoreHelper> <BEA-000000> <Incomplete connection reference object for connection:myConn>
    After this message, on the WLS_A the application runs and continue without connection problems, while on WLS_B, after this message the application does not start, and the WLS complains that it can not resolve the JNDI connection.
    I have the same connection description on both servers, with the same JNDI name.
    From within JDeveloper, where I have the application, I set in the AppModule.xml the values for the configurations: AppModuleShared and AppModuleLocal.
    If I set AppModuleShared and AppModuleLocal to JDBC Datasource, I can deploy on both servers, and the application works on both WLS_A and WLS_B.
    If I set AppModuleShared and AppModuleLocal to JDBC URL, I can still deploy on both servers, but the application works only on WLS_A.
    Thanks so far for the answers, but I'm still baffled by this WLS behavior..
    Sergio.

  • JDBC URL for Two Oracle Nodes

    Hi All,
    I have two DB nodes which are running independently (Mean no RAC), I want to configure JDBC URL for these nodes that if one node goes down my application automatically connected to second one.
    Both nodes have different HOST and SID.
    Regards,
    imran

    Hi jwenting,
    I tried following URL in PL/SQL developer and my fail over is working fine with separate nodes, Only thing i did was i keep SID of both nodes with same name.
    ERS=(DESCRIPTION=(FAILOVER=on)(LOAD_BALANCE=off)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.5.130)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.5.133)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))
    But strange when i connected this through JDBC URL like following it gives me error of invalid URL
    jdbc:oracle:thin:@(DESCRIPTION=(FAILOVER=on)(LOAD_BALANCE=off)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.5.130)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.5.133)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))
    Regards,
    imran

  • Jdbc url for yahoo finance

    Hey guys,
    Can anyone please help me find out what is the JDBC url for Yahoo Finance Database that stores the values of the historical stock quotes . I desperately need it for my java application in which I require to access the database in order to get the high, low, open, close quotes of a stock index. Any help would be greatly appreciated.
    Thank you,
    Vivek

    Hi!!
    The URL to the database on the yahoo webpage is http://chart.yahoo.com/d . If you go to that link then you will be able to access the database and do a search on it.
    Please reply. Any help will be greatly appreciated.
    Thank you,
    Vivek

  • JDBC URL for Two Oracle Nodes with different SID

    Hi All,
    I have two DB nodes which are running independently (Mean no RAC), I want to configure JDBC URL for these nodes that if one node goes down my application automatically connected to second one.
    Both nodes have different HOST and SID but the tables i am going to access have same structure. we are using this DB for some logging purpose that's why we didn't choose RAC option.
    Regards,
    imran

    For RAC database, I used:
    jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port))(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=port)))(CONNECT_DATA=(SERVICE_NAME=servicename)))
    For non RAC database you could ommit LOAD_BALANCE setting, and set correct hostname & port for both nodes. We connected using common service name. If your databases have different service names, then the SID will have to be part of ADDRESS somehow - maybe (SID=sid).
    I have to mention though that unless the main reason behind your decision was lower cost without RAC (and you don't need to store any information apart from logs), it was a wrong decision. If you decide to store any additional information in the database for whatever reason (new requirements), you are in trouble.

Maybe you are looking for

  • ITunes TV Show Season Pass Issues - How is it working for you?

    I love iTunes Season passes.  I love letting a show accumulate without worrying about storms, sports messing up recording times, power outages, storage of my DVR, etc...  The shows are always going to be there to watch.  However for well over a year

  • Attributes

    Hi, i have a dimension which is supplier which has vendor and ultimate Vendor info objects. and when i check the contents of the cube  under this dimension i see 3 info objects vendor, ultimate Vendor and also global vendor. i assumed this cud be att

  • 9iAS Release 2 Forms/Reports Servers

    With 9iAS Rel1, there was a forms and a reports startup script for the servers. I'm not seeing this with Release 2. Also, we have had problems with Reports with regards to the DISPLAY environment setting. Where do I alter the DISPLAY for the reports

  • How to change a double to 2 or less decimal places

    hi im trying to change a double to 2 decimal places the reason is i have a angle that is sesitive to 1.0 x14 and it look rediculas to look at :) i think on a calculater you use E exponents but im unsure.

  • Why use app server and EJB?

    we have a project about Component-based Library for Business Information Systems. We have chosen Point-Of-Sales System as the type of our system. why do we need to use app server and EJB? Hope can have replies soon. Thanks so much! regards beginning