DBPing Utiity In Weblogic
The dbping command-line utility tests the connection between a DBMS and your client machine via a JDBC driver. You must complete the installation of the driver before attempting to use this utility.
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
$ java utils.dbping DBMS [-d dynamicSections] user password DB
$ java utils.dbping ORACLE_THIN USERNAME PASSWORD IP:PORT/SID
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);