[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: How to authenticate to the JBoss server from a desktop (
Marcos_APS
do-not-reply at jboss.com
Wed Jul 2 15:25:46 EDT 2008
Just an edit of the last post:
| private Dados(String sql) throws LoginException
| {
| final String nomeFonteDados "java:/LaboratorioInformaticaDS";
| try
| {
| InitialContext contexto = new InitialContext();
| // The error happens in the line bellow, after fContextoLogin.login();
| DataSource fonteDados =
| (DataSource) contexto.lookup(nomeFonteDados);
| fConexao = fonteDados.getConnection();
| fInstrucao = fConexao.prepareStatement(sql);
| fInstrucao.setString(1, getUsername());
| fDados = fInstrucao.executeQuery();
| }
| catch (NamingException ex)
| {
| LoginException excecao = new LoginException(
| "Erro ao localizar fonte de dados: '" + nomeFonteDados + "'.");
| excecao.initCause(ex);
| throw excecao;
| }
| catch (SQLException ex)
| {
| fechar();
| LoginException excecao = new LoginException("Erro de SQL.");
| excecao.initCause(ex);
| throw excecao;
| }
| }
|
Marcos
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162159#4162159
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162159
More information about the jboss-user
mailing list