Simples.
Est� faltando um try .. catch() no class.forName.
At 16:03 20/11/01 -0300, you wrote:
> Amigos, criei uma classe para conectar o Oracle e esta dando problemas.
>Alguem poderia me sugerir como corrigir? { String strUrl;
> String strUsuario;
> String strSenha;
> Connection conexao;
>
> {
>
> {
> this.strUrl = "jdbc: odbc: TESTE_MC";
> this.strUsuario = "teste";
> this.strSenha = "teste";
> }
> {
> this.strUrl = "jdbc: odbc: TESTE_DESENV";
> this.strUsuario = "testedesenv";
> this.strSenha = "testedesenv";
> }
>
>
> conexao = DriverManager.getConnection(this.strUrl, this.strUsuario,
>this.strSenha);
>
> return conexao;
> }
>
> {
>
> }
>
>}
> O erros foram os seguintes na compila��o: OlaInternet.java:27:
>unreported exception java.lang.ClassNotFoundException; must be caught or
>declared to be thrown Class.forName("oracle.jdbc.driver.OracleDriver"); ^
>OlaInternet.java:28: unreported exception java.sql.SQLException; must be
>caught or declared to be thrown conexao =
>DriverManager.getConnection(this.strUrl, this.strUsuario, this.strSenha);
>Agrade�o desde j� pela ajuda Jefferson
------------------------------ LISTA SOUJAVA ----------------------------
http://www.soujava.org.br - Sociedade de Usu�rios Java da Sucesu-SP
d�vidas mais comuns: http://www.soujava.org.br/faq.htm
regras da lista: http://www.soujava.org.br/regras.htm
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------