Where to store Database info in weblogic 6.0

Discussions

XML & Web services: Where to store Database info in weblogic 6.0

  1. Where to store Database info in weblogic 6.0 (2 messages)

    I want to write a small application which uses a API (Java class, not JSP or servlet) for database connectivity. A JSP file acts as the client for the API. Since Iam new to weblogic 6.0, I don't know where to write the database info(like driver name, URL, username, pwd etc.,) and how to get those info from the Java API. Could anyone explain me about the process. Also, is there any website for the solution.

    Thanks
    AJP
  2. Where to store Database info in weblogic 6.0[ Go to top ]

    how's about xml (kind of config.xml) that will contains your properties, therfiore you can write an api that allows you to retrive these informations and pass them to your jsp.
    you can use xerces api for the retrieval operations.

    @+
  3. Config.xml is the place to do it

    e.g.

    Setting up the JDBC Connection pool

    <JDBCConnectionPool CapacityIncrement="3"
       DriverName="oracle.jdbc.driver.OracleDriver" InitialCapacity="1" LoginDelaySeconds="1" MaxCapacity="5" Name="pool/xxxx" Properties="user=USERNAME;password=PASSWORD;dll=ocijdbc8;server=172.16.xx.xx:1521:prodb;protocol=thin"
            RefreshMinutes="15" ShrinkPeriodMinutes="15"
            ShrinkingEnabled="true" Targets="myserver"
            TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
            TestTableName="dual" URL="jdbc:oracle:thin:@172.16.xx.xx:1521:prodb"/>


    Setting up the JDBS Data Source.
    <JDBCTxDataSource EnableTwoPhaseCommit="true"
            JNDIName="ds/tx/xxxxx" Name="ds/tx/xxxxxxx"
            PoolName="pool/xxxxx" Targets="myserver"/>

    When u have to get a access do a JNDO lookup on the datasource.

    You will get some more information on weblogic edocs\

    Regards
    Hrishi