Can set charset in jdbc url string?

can set charset in jdbc url string
like mysql
?

China,
As far as I know, you cannot set the charset in the JDBC URL string. However, there are ways to set it. Although I have no experience with setting the charset, I believe the "Oracle JDBC User's Guide and Reference" contains this information. The guide is available from:
http://tahiti.oracle.com
Allow me to give you some advice. Each DBMS does things differently. Oracle's JDBC driver does not work exactly the same way as the JDBC driver for "mySQL". You need to learn how Oracle's JDBC driver does things. In my opinion, the "Oracle JDBC User's Guide nad Reference" is very good for learning how to use Oracle's JDBC driver.
Good Luck,
Avi.

Similar Messages

  • Can't use JDBC URL for multiple LDAPs

    ColdFusion 8,0,1,195765 Enterprise (Trial)
    We use Oracle OID (LDAP) instead of tnsnames.ora to resolve database connection strings. This is how I specify one LDAP JDBC URL. On the CF admin page, Server Settings, Java and JVM, ColdFusion Class Path is set to C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar. Under Data & Services, Data Sources, create a new source. Set JDBC URL to
    jdbc:oracle:thin:@ldap://mdaoid1.mycompany.com:389/mdad2,cn=OracleContext,dc=mycompany,dc= com
    where mdaoid1 is one of the two Oracle OID servers that resolve connection strings, and mdad2 is an entry in the two OID's sync'ed to each other. That works.
    According to many sources based on Google search for "space separated LDAP URLs", I should be able to add another LDAP server separated by space. Now I append " ldap://mdaoid2.mycompany.com:389/mdad2,cn=OracleContext,dc=mycompany,dc=com" (no quotes, added to indicate leading space) to that string. Upon clicking Submit, I get
    Connection verification failed for data source: orcl10g3
    java.sql.SQLException: For input string: "389 ldap:"
    The root cause was that: java.sql.SQLException: For input string: "389 ldap:"
    (orcl10g3 is the CF data source name I'm creating) Some say I need to replace space with %20 in the double LDAP URL. With %20, I get error
    Connection verification failed for data source: orcl10g3
    java.sql.SQLException: Io exception: JNDI Package failurejavax.naming.InvalidNameException: Invalid name: mdad2,cn=OracleContext,dc=mycompany,dc=com ldap://mdaoid2.mycompany.com:389
    The root cause was that: java.sql.SQLException: Io exception: JNDI Package failurejavax.naming.InvalidNameException: Invalid name: mdad2,cn=OracleContext,dc=mycompany,dc=com ldap://mdaoid2.mycompany.com:389
    Question: How do I add more than one LDAP server to the JDBC URL so I can achieve failover and load balance?
    Yong Huang
    yong321 at yahoo.com

    The message above was posted by me two years ago and was brought to my attention today. Here's a short update: The network team added a load balancer mdaoid in front of, and resolved to, mdaoid1 and mdaoid2 (in round-robin fashion). The problem described in this thread is bypassed because the JDBC URL can simply use one-OID format, in which mdaoid is used as the LDAP server.

  • I have a pop up which I can't get rid of which states: "There is no application set to open the URL ximadpzl://save_ximad_token----/"

    I can't get rid of a message which keeps popping up which says:
    There is no application set to open the URL ximadpzl://save_ximad_token/(etc)
    I have no idea to what they are referring and I can find no application which satisfy this requirement. How do I get rid of this message? It won't go away. I have tried turning off the computer, closing Safari, etc.

    All of these suggestions (delete caches, restart, terminal commands, etc) do nothing to actually LOCATE the problem. They are just standard purging processes, and they have all failed to achieve resolution.  And it is NOT Little Snitch either (tried turning that off and nothing changed).  All these forums on this matter have been speculative and useless.
    Ladies and Gents... I have found and isolated the ACTUAL PROBLEM.  It is a Safari Extension that is doing it... specifically "VideoCatcher 5.3.8" which for me was installed with MovieSherlock.  The extension adds the ability to download YouTube movies directly from Safari (by showing a small download button next to any embedded movie). When I remove that extension, all the annoying pop-ups go away.
    MovieSherlock is not the only utility that does this however. There are several YouTube downloaders out there that ALL install an extension that detects YouTube videos on the page. I bet my hat that many (if not all) of you who are experiencing this pop-up issue... have installed one of those downloader utilities.
    So, the solution is simple: disable that extension. If you need to download a YouTube video from a page, either temporarily enable that extension again as needed, or leave the Safari integration disabled and launch the actual utility itself and enter the URL into it for your download.
    I would expect that MovieSherlock and the other YouTube downloading utilities will need to update their extensions (soon?) to deal with Yosemite's new browser script management.
    PROBLEM SOLVED.

  • Can I pass variables in the URL string?

    I am trying to get some variables into a loaded swf at
    runtime. The variables will carry information so the swf can load
    the correct xml file. I thought we could pass them through the URL
    string like so:
    new URLRequest("testing.swf?myVar=varOne
    but it just throws an URL cannot be found error. How can I
    get variables into my swf at runtime?

    What you are doing is fine. But you will always get that
    error when testing
    the movie (Ctrl+Enter). Try it in a browser and it should
    work.
    BTW, another way of doing the same is to use a URLVariables
    object, like so:
    var req:URLRequest = new URLRequest("testing.swf");
    var vars:URLVariables = new
    URLVariables("myVar=varOne&myVar2=varTwo");
    req.data = vars;

  • How can i get getwayed url string using pluggable nav in news portlet?

    hi.
    How can i get getwayed url string using pluggable nav in news portlet?
    A code just like below is what I want.
    <param value="param=http://.../portal/server.pt/gateway/PTARGS_.../http/...">
    I tryed the following, but didn't work as I wanted.
    1.<param value="<pcs:valueexpr='var'/>">
    -> transformed. but I want the prefix 'param=' in the enquoted string's too.
    2. <param value="param=<pcs:valueexpr='var'/>">
    -> not transformed.
    Any idea?
    Hiroyuki

    Hi all,
    We have HPROF functionality in our latest roadmap, so you will see that feature in our next major release called JRockit R28.
    I recommend, above from the MemLeak documentation suggested by Makiey, the following information on how to use JRockit tools.
    Performance Tuning & Profiling:
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_02.html
    Using JRockit tools:
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_03.html
    Diagnostics & Troubleshooting
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_04.html
    Best Regards,
    Tuva
    JRockit PM

  • Won't let me download Adobe Photoshop Trial version. It said "there is no application to set to open the url...." Can't find what app to use?

    Won't let me download Adobe Photoshop Trial version. It said "there is no application to set to open the url...." Can't find what app to use?

    use a different browser to download.

  • JDBC URL can break config.xml

    Entering a JDBC URL of jdbc:mysql://foo.com/db?user=joe&password=smith
    will result in config.xml not being parsible after it is saved. The
    problem is that the ampersand needs to be translated into a character
    entity (&). I suppose other nasty character entities such as <
    should be translated too.
    Ben

    This problem has been acknowledged and engg is working on this issue.
    Thanks.
    Kumar
    Ben Eng wrote:
    Entering a JDBC URL of jdbc:mysql://foo.com/db?user=joe&password=smith
    will result in config.xml not being parsible after it is saved. The
    problem is that the ampersand needs to be translated into a character
    entity (&). I suppose other nasty character entities such as <
    should be translated too.
    Ben

  • Proxy Authentication with JDBC Datasource instead of JDBC URL?

    Hello,
    A requirement for my current project (ADF 10g) is that a user should be able to log in with his regular database account. For the moment, this is implemented using Proxy Authentication, as described in the following article:
    http://blogs.oracle.com/jheadstart/2008/01/using_proxy_authentication.html
    For now, we are using a JDBC URL defined in the application module config for the BC. In short: a ProxyAuthConnectionPoolManager class was created that overrides the default ConnectionPoolManagerImpl. The getConnection method has been overridden to create a standard connection (with the username/pw defined on the AM), and additionally, create a proxy connection within this connection with the specific user credentials. The (simplified) code:
        public Connection getConnection(String key, String url, Properties props, String username, String pwd) {
            // first fetch a default connection from the pool through the superclass
            Connection connection = super.getConnection(key, url, props, username, pwd);
            // cast into an OracleConnection
            OracleConnection oraConnection = (OracleConnection) connection;
                // close any proxy sessions that would still exist on the connection
                if (oraConnection.isProxySession()) oraConnection.close(OracleConnection.PROXY_SESSION);
                // get a handle on the session scope
                Map sessionScope = ADFContext.getCurrent().getSessionScope();
                if (sessionScope != null) {
                    // find the user object in the session (the account the user logs in with)
                    ProxyAuthUser user = (ProxyAuthUser) sessionScope.get(ProxyAuthUser.JHS_USER_KEY);
                    if (user != null) {
                        // create a property map with the end user credentials
                        Properties proxyProps = new Properties();
                        proxyProps.put(OracleConnection.PROXY_USER_NAME, user.getDbUsername() + "/" + user.getDbPassword());
                        proxyProps.put(OracleConnection.PROXY_USER_PASSWORD, user.getDbPassword());
                        // open the proxy session
                        oraConnection.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, proxyProps);
                return oraConnection; 
        }Now, this works perfectly when using a JDBC URL. But when I switch the JDBC Datasource the ProxyAuthConnectionPoolManager class is not called anymore. This is all done in code in the Application Server. While using a JDBC Datasource is actually necessary: otherwise for each environment (dev, test, production,...) a different WAR file is needed.
    What class can I override with code similar to the piece above, to open a proxy connection inside the existing connection, when using a JDBC Datasource?
    Your help would be greatly appreciated!
    Chris

    Hello Krasimir,
    Frank Nimphius gave me the solution to this problem. The prepareSession is indeed the best place to put the code:
       private OracleConnection oconn = null;
       public void prepareSession(SessionData SessionData) {
          super.prepareSession(SessionData);
          oconn = ((PrxyTransactionImpl)this.getDBTransaction()).getPrxyConnection();
          // Specify the user that connects through the proxy user and its roles
          Properties prop = new Properties();
          prop.put(OracleConnection.PROXY_USER_NAME,"hr");
          prop.put(OracleConnection.PROXY_USER_PASSWORD,"hr");
          //prop.put(OracleConnection.PROXY_ROLES, roles);
          // Open the proxy session (DB-authenticated users)
          try {
             oconn.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, prop);
          catch (SQLException e) {
             // Close the connection, to avoid connection to remain open after exception
             oconn.abort();
             e.printStackTrace();
       }But Frank also created the following helper classes to extend the ADF BC behavior:
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jbo.server.DatabaseTransactionFactory;
        * TransactionFactory that returns PrxTransactionImpl, which is a subclass of
        * DBTransactionImpl2
        * @author Frank Nimphius
       public class PrxyDatabaseTransactionFactory extends DatabaseTransactionFactory {
          public PrxyDatabaseTransactionFactory() {
             super();
           * Override the create method to return an instance of PrxyTransactionImpl instead
           * of DBTransactionImpl2
           * @return PrxyTransactionImpl
          public DBTransactionImpl2 create() {
             return new PrxyTransactionImpl();
       package oracle.sample.dbprxy.adfbc;
       import oracle.jbo.server.DBTransactionImpl2;
       import oracle.jdbc.internal.OracleConnection;
       public class PrxyTransactionImpl extends DBTransactionImpl2 {
          public PrxyTransactionImpl() {
             super();
           * The DBTransactionImpl2 does not expose the connection in a public
           * method. This class is a wrapper to expose the connection to the
           * BC app, so it can be accessed in the ApplicationModuleImpl class
           * @return OracleConnection - SQL Connection
          public OracleConnection getPrxyConnection() {
             return (OracleConnection) this.getJdbcConnection();
       }In the configuration of your Application Module, you have to set the property "TransactionFactory" (normally the last one in the list) to oracle.sample.dbprxy.adfbc.PrxyDatabaseTransactionFactory. This way, the DBTransaction() of your AM will have a getPrxyConnection() method and you will have the connection at your disposal. You won't need the createPreparedStatement in your code anymore.
    To close the connection, this is the code behind my "logout button" on the backing bean. Application Module Pooling and Connection Pooling will take care of the rest for you!
       ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
       HttpSession session = (HttpSession)ectx.getSession(false);
       session.invalidate();Another thing: be sure to set the internalconnection property to a different JDBC Datasource (or file based) than the one you are using to connect to the database (the default value). Otherwise connection pooling will be confused and there will be too much pending database connections.
    This works for me, all sessions are closed in time and logging out seems secure. I do not have my complete, adjusted code here at my disposal, but next week, when I'm back at work, I'll have a look to see if there is anything I forgot to mention. So this should get you started, but I'll keep you posted!
    A huge thank you to Frank again for helping me (/us) out with this problem!! And sorry I forgot to post the answer here sooner. I was too busy with testing it. :-)
    Regards,
    Chris

  • Connection with Advanced - custom JDBC URL fails with some valid JDBC-URLs

    Hi,
    I am trying to create a connection with a custom JDBC connection string, but SQL*Developer throws the error message:
    Status : Failure -Test failed: Required property 'hostname' is not set on the DatabaseProvider my tests are:
    <li> with connection via Connection Type set to TNS and a proper alias - it works fine
    <li> with connection via Connection Type set to Advanced and exactly the same values from tns in the url: jdbc:oracle:thin:@(DESCRIPTION=(enable=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=172.24.32.113)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=RESTSVP_SITE1))) - it fails with Status : Failure -Test failed: Required property 'hostname' is not set on the DatabaseProvider<li> with JDBC URL set to jdbc:oracle:thin:@172.24.32.113:1521/RESTSVP_SITE1 - it works fine
    As my jdbc url is quite close to the example in [url http://docs.oracle.com/cd/E11882_01/java.112/e16548/apxtblsh.htm#CHDBBDDA]Using JDBC with Firewalls maybe someone can help me to fix it?
    Martin
    Edited by: berx on Oct 12, 2012 11:32 AM - fixed typos

    Hi Martin,
    1/oci/thick
    2/RAC options
    3/TNS connection
    1/oci/thick
    OCI driver has a slightly different set of features than thin:
    -try oci/thick (requires Oracle Client, server or instant client) (It requires SQLDeveloper java and .dll, .so libraries to match)Re: SQL developer 3.1 shows error Incompatible version of libocijdbc
    jdbc:oracle:oci:@(DESCRIPTION=(enable=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=your_host_name)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=your_service_name)))
    2/RAC options
    More speculatively:
    -Try sid instead of service name (will disable some networking features on that connection), try switching load balancing off.
    From: Unable to access RAC from SQL Developer!
    In general and especially for RAC database you should use SERVICE_NAME to connect and not SID (because only SERVICE_NAME can use load balancing and failover features):
    3/TNS connection
    with connection via Connection Type set to TNS and a proper alias - it works fine(Which Connection Type TNS did you use? TNS Connect Identifier = oci/thick, TNS Network alias (can be thin (I should check, might depend on oci/thick checkbox))
    Is this issue stopping your work i.e. is this workaround unacceptable?
    -Turloch
    SQLDeveloper team

  • 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

  • Wrong SID in JDBC URL

    Hi all,
    I'm developing a java program in OAF context to generate a pdf from a xdo data template and template. this is already working, there is only one issue.
    The DataProcessor needs a connection, therefore I've specified hardcoded a JDBC URL.
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:apps/apps@(DE.............");
    and then pass conn to the DataProcessor.
    dataprocess.setConnection(conn);
    But i want to get rid of this hardcoded connection.
    So I did the following:
    OAApplicationModuleImpl am = (OAApplicationModuleImpl)pageContext.getRootApplicationModule();
    String JDBCURL = am.getOADBTransaction().getConnectionMetadata().getJdbcURL();
    System.out.println(JDBCURL");
    as result a wrong connectionstring: ....com)(PORT=1533)))(CONNECT_DATA=(SID=1533)))
    he takes for SID the port number....
    questions I have:
    - the way I work is correct?
    - where does he gets his jdbc url from? becuase I already checked my database in jdev and it works (with correct SID) and also my dbc file is correct...
    Thanks in advance!
    Stijn

    Stijn ,
    You can get connection from OADBTransactionImpl in AM.Here is the sample code:
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.OADBTransactionImpl;
    import oracle.jdbc.driver.OracleConnection;
    OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getOADBTransaction();
    OracleConnection conn = (OracleConnection)oadbtransactionimpl.getJdbcConnection();
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I test if an URL is valid in Actionscript 3.0 ?

    Hy, everyone!
    I`m trying to make a function that tests to see if an URL is
    valid and return true if it is, false otherwise, so that I can use
    it in an 'if' statement.
    The way I try to do it is by using two event listeners for
    the 'contentLoaderInfo' proprety of a Loader: one for Event.OPEN(if
    this event is dispatched, then I know the URL is valid) and one for
    IOErrorEvent.IO_ERROR(if this event is dispatched, then I know the
    URL is not valid).
    But the problem is that by using the event handler functions,
    I leave the main URL tester function, and am unable to return a
    value from it. The way I thought of to get around this problem was
    to set a returnValue variable, to which to assign the return value
    of the two event handler functions and then just go 'return
    returnValue;'. But I don`t know how to return a value from a event
    handler function, and even if I did I still couldn`t do it that
    way, because it takes some time to dispatch those events and the
    'returnValue' variable would be undefined by the time I try to
    return it.
    I hope you understood what I tryed to explain above... Here`s
    some code to ilustrate this better(it`s not valid, it`s just so you
    understand my problem):
    private function testUrl(url:String):void {
    var returnValue:Boolean;
    var loader:Loader = new Loader();
    returnValue =
    loader.contentLoaderInfo.addEventListener(Event.OPEN, onGoodUrl);
    // This is a global variable to which I assign the value of
    'loader' so that I can close it from onGoodUrl
    _testLoader = loader;
    returnValue =
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
    onBadUrl);
    loader.load(new URLRequest(url));
    // Even if I knew how to make an event handler that returns a
    value, I`d still have to wait for the loading to start, and I
    couldn`t return the value here:
    return returnValue;
    private function onGoodUrl(event:Event):Boolean {
    _testLoader.close();
    return true;
    private function onBadUrl(event:IOErrorEvent):Boolean {
    return false;
    You know any way to go around this problem? Or, for that
    matter, do you know any other way to test for a valid URL?
    Thank you for your time!

    You need to test httpStatus of the URLLoader. Streaming
    content undergoes a specific process when coming into Flash. The
    only issue with httpStatus is that it does not work for every
    browser....mostly Linux based systems and lesser programs on the
    evolutionary food chain. I have not experienced problems with IE or
    NS/FF on Vista at this point.
    1. Send Request
    2. Receive HTTP Status (HTTPStatusEvent.HTTP_STATUS)
    3a. Status Good - Begin Load (Event.OPEN)
    3b. Status Bad - 404 or Protected Filed
    (IOErrorEvent.IO_ERROR)
    4. Receive File - Downloading (ProgressEvent.PROGRESS)
    5. Download Complete (Event.COMPLETE)

  • 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.

  • 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.

Maybe you are looking for

  • Change log issue in BRF process workflow SRM 7.0

    Hi Experts, I am new to SRM workflow. At the moment I have a requirement in SRM 7.0 BRF process control workflow.My requirement is to capture the changes done by the shopping cart approver's and also the changes done by shopping cart requestor. Below

  • How can I keep my old software?

    Hi, I'm planning to clean install my mac, but how can I keep my software that is already in there? Because I do not have the cd to reinstall it after the clean install.

  • Exporting/Importing VM, How to match network?

    I'm planning to migrate a VM this week but notice from the instructions i'm using that it mentions to "Make sure the same Virtual Network is defined on the import host as on the export host. This means it will connect the imported VM to the correct n

  • IPad to non sync'd iMac

    how do you download photos from iPad to non sync'd iMac

  • Using corporate Proxy servers

    Hi, I'm having some problems using my iPad through a corporate proxy. I have my Wi-Fi configured up correctly and have set the proxy settings using manual settings. This all works fine and I can access none secure services. However, when I try to con