File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Cannot import jdbc driver  -- answered Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot import jdbc driver  -- answered" Watch "Cannot import jdbc driver  -- answered" New topic
Author

Cannot import jdbc driver -- answered

Rob Brew
Ranch Hand

Joined: Jun 23, 2011
Posts: 99
EDIT: Answer was to use the line:


Hi all.

I've been at this for hours with no joy, I'm trying to use the jConnect library from SAP for a system running SQL Anywhere. The code cannot find the drivers even though i've imported the jconn4.jar into NetBeans.
I've also tried the open source driver.

here's the stack trace:


and here's my hibernate.cfg.xml file:


any ideas greatly appreciated.

Rob Brew.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Are you sure that the class name you are using for the JDBC driver is correct? If I look at this page in the documentation, it says that the class name should be:

com.sybase.jdbc4.jdbc.SybDriver

That's slightly different that what you're using. It might be different with different versions. Make sure you're using the right settings for the version of the driver that you're using.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot import jdbc driver -- answered
 
Similar Threads
JDBC Driver class not found:
Hibernate for Teradata
hibernate one-one mapping example issue
hibernate hello world
HibernateException Pls Help