"No suitable driver" usually means that the JDBC
URL you've supplied to connect has incorrect syntax or when the driver isn't loaded at all.
When the method getConnection is called, the DriverManager
will attempt to locate a suitable driver from amongst those loaded at initialization and those loaded explicitly using the same classloader as the current applet or application.(using Class.forName()
)
For Example
import oracle.jdbc.driver.OracleDriver;
Class.forName("oracle.jdbc.driver.OracleDriver");
Also check that you have ojdbc6.jar
in your classpath. I would suggest to place .jar
at physical location to JBoss "$JBOSS_HOME/server/default/lib/"
directory of your project.
EDIT:
You have mentioned hibernate
lately.
Check that your hibernate.cfg.xml
file has connection properties something like this:
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>