A hora que puxo do banco esta:
1899-12-30 09:52:12
Coloco o codigo para formata-la:
Date d = temp.getTime(“Hora”);
SimpleDateFormat s = new SimpleDateFormat(“hh:mm:ss”);
out.print(s.format(d));
porém esta dando o seguinte erro:
C:\Documents and Settings\BR0095211797\TESTE\build\generated\src\org\apache\jsp\lista_005ffinal03_jsp.java:170: d is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
Date d = temp.getTime(“Hora”);
^
C:\Documents and Settings\BR0095211797\TESTE\build\generated\src\org\apache\jsp\lista_005ffinal03_jsp.java:170: incompatible types
found : java.sql.Time
required: java.sql.Date
Date d = temp.getTime(“Hora”);
^
C:\Documents and Settings\BR0095211797\TESTE\build\generated\src\org\apache\jsp\lista_005ffinal03_jsp.java:171: s is already defined in _jspService(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
SimpleDateFormat s = new SimpleDateFormat(“hh:mm:ss”);
^
3 errors
C:\Documents and Settings\BR0095211797\TESTE\nbproject\build-impl.xml:364: The following error occurred while executing this line:
C:\Documents and Settings\BR0095211797\TESTE\nbproject\build-impl.xml:149: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)
leia as mensagens de erro.
1 - a primeira diz que a variavel d ja esta definida, ou seja, vc ja declarou uma varivel com esse nome.
2 - a segunda vc ta tentando atribuir a uma variavel do tipo Date o retorno de um metodo que retorna Time.
3 - Idem a 1, a variavel s ja foi definida antes.