Discussions

EJB programming & troubleshooting: How to Connect Oracle data base Using weblogic server

  1. I am unable to connect to the oracle database I tried all the possible ways that are mentioned in the examples/docs ,but I am unable to connect by using thin driver.Can anybody please help me out.If possible write the code.

    thakz in advs
    job gunti
  2. Are you trying to use the connection pooling, or is it that you just can't connect at all? n.b, is this a language problem or possibly a db problem?
  3. Below is the weblogic.properties we use to create a connection pool. Remember to include the Oracle jdbc jar file in the weblogic class path. Let me know if this helps.
    # Create pool
    weblogic.jdbc.connectionPool.Pool=\
    url=jdbc:oracle:thin:@MISSOURI:1521:database,\
    driver=oracle.jdbc.driver.OracleDriver,\
    loginDelaySecs=1,\
    initialCapacity=1,\
    maxCapacity=10,\
    capacityIncrement=2,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    refreshMinutes=10,\
    testTable=dual,\
    props=user=<usename>;password=<password>

    # Set allow to everybody
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.Pool=guest

    # Register as JNDI datasource
    weblogic.jdbc.DataSource.Source=Pool
  4. How to find oracle jdbc jar.[ Go to top ]

    Hi Friend,
    Thank u for ur message.
    We have a prob now , we are not able to find oracle jdbc jar.
    Please guide me where to find it.

    And let us know more about weblogic.class.path

  5. How to find oracle jdbc jar.[ Go to top ]

    Oracle JDBC jar files can be found in the Oracle installation directory:
    JDK 1.1.x: %ORA_HOME%\Ora81\jdbc\lib\classes111.zip
    JDK 1.2.x: %ORA_HOME%\Ora81\jdbc\lib\classes12.zip

    The weblogic class path is specified using the option -Dweblogic.class.path <classpath> when starting the weblogic server
  6. Hi there..

    As one of my friend said, u can set weblogic.properties file do things.
    Second way is that u can always have ur own connection ,which is sometimes not advisable(I donno why..)
    In ur program, import oracle.jdbc.driver.*; package,and do the following..
    //Look up for driver name
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Then get the connecton
    Connection con = java.sql.DriverManager.getConnection("jdbc:oracle:thin:@10.190.21.5:1521:IFDEV","fstdev","fstdev");

    Once u get the con,do manipulations with it.
    I think I'm clear.