
28/02/2012, 13:40
|
| | Fecha de Ingreso: febrero-2012 Ubicación: Lima
Mensajes: 64
Antigüedad: 13 años, 1 mes Puntos: 1 | |
Respuesta: "main" java.lang.NoClassDefFoundError No no me muestra ningun error!! y si tiene metodo main, este es mi codigo y tiene todas las importaciones que necesita..
public class Prueba1 {
public static synchronized Connection getPoolConnDataCom() throws Exception {
Connection cnx=null;
ConnectionPool pool = null;
BnParametroDb par = new BnParametroDb();
pool = par.getPoolDataCom();
try {
cnx = pool.getConnection();
} catch (Exception e) {
System.out.print("error");
throw e;
}
return cnx;
}
public static void main(String[] args) {
List lsItems=null;
PreparedStatement stmt = null;
ResultSet rs = null;
Connection conn = null;
try{
Conexionoracle cn = new Conexionoracle();
conn = cn.getConectionSRPMH();
//Bnpcf21Item item=new Bnpcf21Item();
String sql="SELECT * FROM TAGENCIAS";
stmt = conn.prepareStatement(sql);
//stmt.setString(1, idTabla);
lsItems=new ArrayList();
rs = stmt.executeQuery();
while(rs.next()){
lsItems.add(rs);
}
}catch(SQLException e){
System.out.print("error");
} catch (Exception e) {
// TODO Bloque catch generado automáticamente
e.printStackTrace();
}finally{
//if(rs!=null){rs.close();rs= null;};
//if(stmt !=null){stmt.close();stmt = null;};
//if(conn !=null){conn.close();conn = null;};
}
for(int i=0; i<lsItems.size(); i++){
System.out.print(lsItems.get(i));
}
}
} |