Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $host = 127.0.0.1;
- my $port = 9001;
- my $url = "a url provided by Hybris";
- $url =~ s/([=;])/uc sprintf("%%%02x",ord($1))/eg;
- my $dsn = "dbi:JDBC:hostname=$host;port=$port;url=$url;";
- my %properties =
- (
- 'user' => 'User provided by Hybris',
- 'password' => 'password provided by Hybris',
- 'host.name' => 'hostname from url provided by Hybris',
- 'host.port' => 'port provided by Hybris'
- );
- my $dbh = DBI->connect($dsn, undef, undef, { PrintError => 0, RaiseError => 1, jdbc_properties => %properties } ) or die "Failed to connect: ($DBI::err) $DBI::errstrn";`
- DBD::JDBC initialisation failed: Can't locate object method "driver" via package
- "DBD::JDBC" at C:/Perl64/lib/DBI.pm line 811.
- Perhaps the capitalisation of DBD 'JDBC' isn't right. at monitorHybrisDB.pl line
- 23
- public class GetHybrisOrders {
- public static void main(String[] args) throws SQLException {
- try {
- // The newInstance() call is a work around for some
- // broken Java implementations
- Class.forName("de.hybris.vjdbc.VirtualDriver").newInstance();
- } catch (Exception ex) {
- // handle the error
- }
- Connection conn = null;
- try {
- conn =
- DriverManager.getConnection("jdbc:hybris:flexiblesearch:url Provided by hybris =username &password=password provided by hybris");
- // Do something with the Connection
- } catch (SQLException ex) {
- // handle any errors
- System.out.println("SQLException: " + ex.getMessage());
- System.out.println("SQLState: " + ex.getSQLState());
- System.out.println("VendorError: " + ex.getErrorCode());
- }
- }
- }
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
- at de.hybris.vjdbc.VirtualDriver.<clinit>(VirtualDriver.java:39)
- at java.lang.Class.forName0(Native Method)
- at java.lang.Class.forName(Unknown Source)
- at GetHybrisOrders.main(GetHybrisOrders.java:11)
- Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
- at java.net.URLClassLoader.findClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
- at java.lang.ClassLoader.loadClass(Unknown Source)
- ... 4 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement