quando estiver tratando a excessão, use:
try
{
// o que vc estiver tratando
}
catch (Exception e)
{
    System.out.println("O seguinte erro ocorreu: "+e);
}



__________________________________________________________________________
AcessoBOL, só R$ 9,90! O menor preço do mercado!
Assine já! http://www.bol.com.br/acessobol
Pessoal,

  Alguém saberia como eu faço para capturar, ou seja, associar a uma String,
a mensagem completa de erro?

  Exemplo:

  A mensagem de erro completa é:

java.sql.SQLException: Invalid argument value: Duplicate entry '[EMAIL PROTECTED]'
for key 2
 at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)
 at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
 at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
 at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
 at org.gjt.mm.mysql.PreparedStatement.executeUpdate(Unknown Source)
 at 
ibest.cadportal.database.Ptl_IdentificacaoDAO.insert(Ptl_IdentificacaoDAO.java:292)
 at 
ibest.cadportal.logic.Ptl_IdentificacaoLogic.insert(Ptl_IdentificacaoLogic.java:287)
 at 
_jsp._site._cadastro._index_0valida__jsp._jspService(_index_0valida__jsp.java:1295)
 at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
 at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
 at com.caucho.jsp.Page.service(Page.java:410)
 at com.caucho.server.http.Invocation.service(Invocation.java:319)
 at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
 at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333)
 at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266)
 at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
 at java.lang.Thread.run(Thread.java:484)

 Eu só consigo pegar somente:

java.sql.SQLException: Invalid argument value: Duplicate 
entry '[EMAIL PROTECTED]' for key 2

  Um abraço a todos,

  Carlos Augusto
------------------------------ 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
historico: http://www.mail-archive.com/java-list%40soujava.org.br
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------

Responder a