Hola, eu estou comenzando a programar em Java e tenho instalado NetBeans IDE 4.0 e o banco de dados HSQLDB. Eu tenho este pequeno programa e não consigo ligarme a base de dados.
package teste;
/**
*
-
@author moll
*/
//Importa as Bibliotecas java a serem usadas neste Programa
import java.lang.Object;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
//Declara o nome da classe
public class connection {
public connection() throws Exception
{
Connection c;
Statement stmt;
try
{
Class.forName("org.hsqldb.jdbcDriver");
}
catch(Exception e)
{
System.out.println("Error: failed to load hsqldb jdbc Driver");
e.printStackTrace();
return;
}
c = DriverManager.getConnection("jdbc:hsqldb:hsql://localhost/kalcus", "sa", "");
stmt = c.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet uprs = stmt.executeQuery("SELECT * FROM Sections");
while (uprs.next())
{
int sec_id = uprs.getInt("sec_id");
String sec_name = uprs.getString("sec_name");
String sec_obs = uprs.getString("sec_obs");
}
}
}
Me da o siguinte error,
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: “java.sql.SQLException: No suitable driver”
Por favor ajudenme, podem responder por meu e-mail
ismelymei@hotmail.com