Friday, June 24

DBPing Command


DBPing Utiity In Weblogic


Ensure you have set weblogic.jar in the classpath and have JAVA_HOME set properly before executing the dbping command.
1)export PATH=/jdk150_11/bin:$PATH
2)export CLASSPATH=$CLASSPATH: /Weblogic/utils/bea101/wlserver_10.0/server/lib/weblogic.jar

Follow the synatax available on utils.dbping 
$ java utils.dbping DBMS [-d dynamicSections] user password DB 
$ java utils.dbping ORACLE_THIN USERNAME PASSWORD IP:PORT/SID

Ex: 
java -cp /WebLogic/utils/bea815/weblogic81/server/lib/weblogic.jar utils.dbping ORACLE_THIN KrishnaDB KrishnaPWD KrishnaDBServer:1536/KrishnaDB


Note: The telnet command and the ping might give as success but that is *NOT* the correct way to check the connectivity to database from WebLogic servers.
 

Examples

The following is an example using the Oracle Thin Driver.
C:\>java utils.dbping ORACLE_THIN scott tiger dbserver1:1561:demo

**** Success!!! ****

You can connect to the database in your app using:

java.util.Properties props = new java.util.Properties();
  props.put("user", "scott");
  props.put("password", "tiger");
  props.put("dll", "ocijdbc9");
  props.put("protocol", "thin");
  java.sql.Driver d =
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
  java.sql.Connection conn =
    Driver.connect("jdbc:oracle:thin:@dbserver1:1561:demo", props);

1 comment: