Skip to Content.
Sympa Menu

freetds - Sv: FreeTDS JDBC Strings>255 and Date

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Carsten Rhod Gregersen" <crg AT rgm.dk>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Sv: FreeTDS JDBC Strings>255 and Date
  • Date: Thu, 25 May 2000 16:46:31 +0200



Here it is, it also fixes a date problem in ECT timezones:

----- Oprindelig meddelelse -----
Fra: RGM FreeTDS mail <freetds AT rgm.dk>
Til: TDS Development Group <freetds AT franklin.oit.unc.edu>
Sendt: 2. maj 2000 12:18
Emne: [freetds] FreeTDS JDBC Strings>255 and Date


> Hi,
>
> I just want to say that I think the Free JDBC driver is great.
>
> I'm having a problem with putting strings which are bigger than
> 255 chars into a text field.
>
> Also I have problems with other timezones (specifically the ECT timezone).
> This problem occur when i try to insert/select dates via
> prepared statements.
>
>
> Big Strings:
> ------------
> I have looked at the code and changed the following code:
>
> comm.appendByte((byte)nativeType);
>
> if (
> actualParameterList[i].value!=null &&
> ((String)actualParameterList[i].value).length()
> > formalParameterList[i].maxLength)
> {
> // XXX This can never happen if the driver is bug
> // free. Perhaps when we are more sure of that
> // we can remove this check.
> throw new TdsException("Internal error. string is "
> +
> "longer than procedure can "
> +
> "handle");
> }
>
> sendSybChar(((String)actualParameterList[i].value),
> formalParameterList[i].maxLength);
>
>
> Too this:
>
>
> if(actualParameterList[i].value != null &&
> ((String)actualParameterList[i].value).length()>255)
> {
> comm.appendByte(SYBTEXT);
> sendSybImage((byte[])((String)actualParameterList[i].
> value).getBytes());
> } else {
> comm.appendByte((byte)nativeType);
> sendSybChar(((String)actualParameterList[i].value),
> formalParameterList[i].maxLength);
> }
>
> break;
>
>
> Which actually works with both varchars > 255 and text fields.
>
>
> Also I have changed:
> long ms =
> ((Timestamp)actualParameterList[i].value).getTime() +
> (nanoseconds / nsPerMs);
>
> Too:
>
> long ms =
> ((Timestamp)actualParameterList[i].value).getTime() +
> (nanoseconds / nsPerMs) -
> (((Timestamp)actualParameterList[i].value).
> getTimezoneOffset() * 60 * 1000);
>
>
> Then it actually works allrigth.
>
>
> crg AT rgm.dk
>
> ---
> You are currently subscribed to freetds as: freetds AT rgm.dk
> To unsubscribe, forward this message to $subst('Email.Unsub')
>
>





Archive powered by MHonArc 2.6.24.

Top of Page