Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleUsing -url and -drivername parameters
./dbviscmd.sh -url jdbc:mysql://localhost:3306/ 
   -drivername MYSQLMYSQL 
   -sql "select * from sakila.actor" 
   -userid root

An alternative to use the -drivername you may use the parameters -driverclass and -driverpath to specify the JDBC driver.

Code Block
languagebash
titleUsing -driverclass and -driverpath parameters
./dbviscmd.sh -url jdbc:oracle:thin:@localhost:1521/ORCL
   -driverclass oracle.jdbc.OracleDriverOracleDriver 
   -driverpath "my_oracle_driver/ojdbc6.jar:my_oracle_driver/orai18n.jar:my_oracle_driver/xdb.jar:my_oracle_driver/xmlparserv2.jar" 
   -sql "select * from HR.COUNTRIES" 
   -userid systemsystem 
   -password oracle

The above example connects to an Oracle instance on localhost and port 1521. Note that the separator character ':' between the different jar files is platform dependant. On Windows-based desktop platforms, the value of this field is the semicolon ";"