Also changed the code to (see attached) and it still throws an
exception after the last        System.out.println("ready2"); Don't
undestand what generally causes this exception.

Code:

        public ArrayList<Rate> getRates() {
                ArrayList<Rate> rates = new ArrayList<Rate>();
                try {
                        PreparedStatement ps = conn.prepareStatement("select 
r.idRates,
p.ascii_name, l.ascii_name, t.ascii_name, " +
                                        "com.company_name, s.ServiceName, 
cnt.CntrType, r.LimitTime,
r.Price, r.ValidFrom, r.ValidTo" +
                                        " from " +
                                        "truckersrates r join geonames p on 
p.geoname_id =
r.PickUp_GeonamesId " +
                                        "join geonames l on l.geoname_id = 
r.Loading_GeonamesId " +
                                        "join geonames t on t.geoname_id = 
r.TurnIn_GeonamesId " +
                                        "join rates_company com on com.id = 
r.Trucker_CompaniesId " +
                                        "join truckersservices s on 
s.idTruckersServices =
r.TruckerServicesId " +
                                        "join cntrtypes cnt on cnt.idCntrTypes 
= r.cntrtypes order by
r.idRates");
                        ResultSet result = ps.executeQuery();
                        result.next();

                        for(int i=1;i<12;i++){
                                 System.out.println(result.getString(i));
                        }
                        System.out.println("ready");
                        result.close();
                        ps.close();
                        System.out.println("ready2");
                }
                catch (SQLException sqle) {
                        System.out.println("No rates available!");
                        }


                return rates;
        }

On Dec 10, 5:23 pm, Nik <[email protected]> wrote:
> I'm new to GWT
> Have written s method to get information for my client side from
> database. When debugging, all goes well until i'm on the line where i
> use getString method.
>
> Best Regards
> Nik
>
> Code :
>
> public ArrayList<Rate> getRates() {
>                 ArrayList<Rate> rates = new ArrayList<Rate>();
>                 try {
>                         PreparedStatement ps = conn.prepareStatement("select 
> r.idRates,
> p.ascii_name, l.ascii_name, t.ascii_name, " +
>                                         "com.company_name, s.ServiceName, 
> cnt.CntrType, r.LimitTime,
> r.Price, r.ValidFrom, r.ValidTo" +
>                                         " from " +
>                                         "truckersrates r join geonames p on 
> p.geoname_id =
> r.PickUp_GeonamesId " +
>                                         "join geonames l on l.geoname_id = 
> r.Loading_GeonamesId " +
>                                         "join geonames t on t.geoname_id = 
> r.TurnIn_GeonamesId " +
>                                         "join rates_company com on com.id = 
> r.Trucker_CompaniesId " +
>                                         "join truckersservices s on 
> s.idTruckersServices =
> r.TruckerServicesId " +
>                                         "join cntrtypes cnt on 
> cnt.idCntrTypes = r.cntrtypes order by
> r.idRates");
>                         ResultSet result = ps.executeQuery();
>
>                         int i=0;
>                         while (result.next()){
>                                 rates.add(i, new
> Rate(result.getString(1),result.getString(2),
> result.getString(3),result.getString(4),result.getString(5),
>
> result.getString(6),result.getString(7),result.getString(8),result.getDate( 
> 9),result.getDate(10),result.getDate(11)));
>                                 i++;
>                         }
>                         result.close();
>                         ps.close();
>
>                 }
>                 catch (SQLException sqle) {
>                         System.out.println("No rates available!");
>                         }
>
>                 return rates;
>         }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to