pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jaume <a1649@dis.ulpgc.es>
To: pgsql-interfaces@postgresql.org
Subject: problem with timestamp (jdbc)
Date: Tue, 04 Apr 2000 11:30:18 +0100
Message-ID: <38E9C43A.B5415CC4@dis.ulpgc.es> (raw)

hi!

ExecGroup-0:err:No class found for datetime.   :-?


*this is the table running under postgresql 6.5.3
*+----------------------------------+----------------------------------+-------+

*|              Field               |              Type                |
Length|
*+----------------------------------+----------------------------------+-------+

*| cod_habitacion                   | int4 not null default nextval('"
|     4 |
*| cod_tipo_habitacion              | int4 not null
|     4 |
*| numero                           | int4 not null
|     4 |
*| planta                           | int4 not null
|     4 |
*| observaciones                    | text
|   var |
*| total_facturado                  | float4
|     4 |
*| noche_ocupada                    | int4
|     4 |
*| noche_libre                      | int4
|     4 |
*| noche_bloqueada                  | int4
|     4 |
*| ultima                           | datetime
|     8 |
*+----------------------------------+----------------------------------+-------+

* Indices:  habitaciones_cod_tipo_habit_key
*           habitaciones_pkey
*/

// here is sniped code

import com.codestudio.util.*;
import java.util.Vector;
import java.util.Date;
import java.sql.*;

public class Habitacion_BDImpl implements Habitacion_Int {

        private final int NOCHE_LIBRE_POS=8;
        private final int NOCHE_BLOQUEADA_POS=9;
        private final int ULTIMA_POS=10;
        private SQLManager manager = null;

 public Habitacion[] Recoge_Habitacion() {

                Habitacion habitacion = null;
                Vector resp = new Vector();

              try {
                   manager = SQLManager.getInstance();
               }catch (PoolPropsException ex) {}

                Connection con = manager.requestConnection();
                PreparedStatement s = null;
                ResultSet res = null;
                try {
                        s = con.prepareStatement("SELECT * FROM
"+TABLA+" WHERE cod_habitacion=?");
                        s.setInt(1,cod.intValue());
                        res = s.executeQuery();
                        while (res.next()) {

habitacion.Set_Numero_Noches_Libre((Integer)res.getObject(NOCHE_LIBRE_POS));


habitacion.Set_Numero_Noches_Bloqueada((Integer)res.getObject(NOCHE_BLOQUEADA_POS));

/--------------->
habitacion.Set_Ultima_Estancia((Date)res.getObject(ULTIMA_POS));
                        }
                } catch (SQLException sqle) { sqle.printStackTrace(); }
                finally {
                       try {
                            s.clearParameters();
                       }catch (SQLException e) {e.printStackTrace();}
               manager.closeResources(s, res);
               manager.returnConnection(con);
   }

Habitacion habitaciones[] = new Habitacion[resp.size()];
                resp.copyInto(habitaciones);
                return habitaciones;
        }
}

// habitacion.Set_Ultima_Estancia expect a Date type ...
// There are any error at compiling time but when I try to run this
method this is the answer:

//ExecGroup-0:err:No class found for datetime.                     //
<----------- ?
// at postgresql.Connection.getObject(Connection.java, Compiled Code)
// at postgresql.jdbc2.ResultSet.getObject(ResultSet.java, Compiled
Code)
// at Habitacion_BDImpl.Recoge_Habitacion_Tipo(Habitacion_BDImpl.java,
Compiled Code)
// at ServerRMImpl.RecogeHab_Tipo(ServerRMImpl.java, Compiled Code)
// at java.lang.reflect.Method.invoke(Native Method)
// at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java,
Compiled Code)
// at sun.rmi.server.UnicastServerRef2.dispatch(UnicastServerRef2.java,
Compiled Code)
// at sun.rmi.transport.Transport$1.run(Transport.java, Compiled Code)
// at java.security.AccessController.doPrivileged(Native Method)
// at sun.rmi.transport.Transport.serviceCall(Transport.java, Compiled
Code)
// at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java,
Compiled Code)
// at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java,
Compiled Code)
// at java.lang.Thread.run(Thread.java, Compiled Code)

// What's wrong and how can I resolve it?





Message-ID: <38E9C43A.B5415CC4@dis.ulpgc.es>
Permalink:  ../38E9C43A.B5415CC4@dis.ulpgc.es/
Also on:    postgresql.org/message-id/38E9C43A.B5415CC4@dis.ulpgc.es

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: a1649@dis.ulpgc.es
  Subject: Re: problem with timestamp (jdbc)
  In-Reply-To: <38E9C43A.B5415CC4@dis.ulpgc.es>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox