Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. my $host = 127.0.0.1;
  2. my $port = 9001;
  3. my $url = "a url provided by Hybris";
  4. $url =~ s/([=;])/uc sprintf("%%%02x",ord($1))/eg;
  5. my $dsn = "dbi:JDBC:hostname=$host;port=$port;url=$url;";
  6.  
  7. my %properties =
  8. (
  9. 'user' => 'User provided by Hybris',
  10. 'password' => 'password provided by Hybris',
  11. 'host.name' => 'hostname from url provided by Hybris',
  12. 'host.port' => 'port provided by Hybris'
  13. );
  14.  
  15. my $dbh = DBI->connect($dsn, undef, undef, { PrintError => 0, RaiseError => 1, jdbc_properties => %properties } ) or die "Failed to connect: ($DBI::err) $DBI::errstrn";`
  16.  
  17. DBD::JDBC initialisation failed: Can't locate object method "driver" via package
  18. "DBD::JDBC" at C:/Perl64/lib/DBI.pm line 811.
  19.  
  20. Perhaps the capitalisation of DBD 'JDBC' isn't right. at monitorHybrisDB.pl line
  21. 23
  22.  
  23. public class GetHybrisOrders {
  24. public static void main(String[] args) throws SQLException {
  25. try {
  26. // The newInstance() call is a work around for some
  27. // broken Java implementations
  28.  
  29. Class.forName("de.hybris.vjdbc.VirtualDriver").newInstance();
  30. } catch (Exception ex) {
  31. // handle the error
  32. }
  33.  
  34. Connection conn = null;
  35. try {
  36. conn =
  37. DriverManager.getConnection("jdbc:hybris:flexiblesearch:url Provided by hybris =username &password=password provided by hybris");
  38.  
  39. // Do something with the Connection
  40.  
  41. } catch (SQLException ex) {
  42. // handle any errors
  43. System.out.println("SQLException: " + ex.getMessage());
  44. System.out.println("SQLState: " + ex.getSQLState());
  45. System.out.println("VendorError: " + ex.getErrorCode());
  46. }
  47.  
  48. }
  49. }
  50.  
  51. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
  52. at de.hybris.vjdbc.VirtualDriver.<clinit>(VirtualDriver.java:39)
  53. at java.lang.Class.forName0(Native Method)
  54. at java.lang.Class.forName(Unknown Source)
  55. at GetHybrisOrders.main(GetHybrisOrders.java:11)
  56. Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
  57. at java.net.URLClassLoader.findClass(Unknown Source)
  58. at java.lang.ClassLoader.loadClass(Unknown Source)
  59. at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  60. at java.lang.ClassLoader.loadClass(Unknown Source)
  61. ... 4 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement