Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #94

Re: jTDS, trashes heap wi

From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: jTDS, trashes heap wi
Message-ID <EbOdnQHVTecbSbXVnZ2dnUVZ_vzinZ2d@comcast.com> (permalink)
Newsgroups comp.lang.java.databases
References <g09odi$m60$1@news.albasani.net>
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
Jan Burse wrote:
> Dear All
> 
> I was just looking up the source code of the jTDS driver.
> It seems that it is trashing the heap with java.lang
> wrapper classes, even when one is using only primitive
> types in his application.

Why do you call this "trashing the heap"?

> For example, when I am doing, whereas the column
> is integer:
> 
>    ResultSet set;
>    set.getLong(1);
> 
> This amounts to a call to:
> 
>     public long getLong(int columnIndex) throws SQLException {
>          return ((Long) Support.convert(con, getColumn(columnIndex),
>                   java.sql.Types.BIGINT, null)).longValue();
>     }
> 
> During the above call a Long object will be created, as
> can be seen from the convert implementation:

Yes, so?

> A solution would be to do the following
> call on the result set:

A solution to what?  You have yet to present a problem.

>    (long)set.getInt(1);
> 
> But what if I want to make the code, lets say column
> size independent, and want to use a getLong() call
> only.

Then just use that call.

> Does this trashing happen in every JDBC driver?

This is not "trashing".  Why do you call it that?

It is likely that all JDBC drivers convert SQL types to reference types in 
Java.  Every column is required to work with ResultSet#getObject() and to 
handle the possibility of a (SQL) NULL value in the column.  NULL is not in 
the domain of primitive values, so the driver really must use a reference type.

> Are there alternatives to jTDS, when accessing
> MS SQL Databases?

jTDS is a stable, performant, high-quality product.  I doubt you'll find better.

What is the problem?  You never stated a problem.

-- 
Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

jTDS, trashes heap with w "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: jTDS, trashes heap wi "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: jTDS, trashes heap wi "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
            Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
              Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web