I do not think that JDBC is inherently the issue here. Think about it - if the
JDBC-ODBC bridge is faster than the JDBC driver, how can that be? They are both
based on JDBC, and the bridge has ODBC in the processing as well. Thus, I would
conclude that the Merant JDBC driver is poorly written. In general, performance
is often determined mostly by the database server's connection protocol, not JDBC.

I have confidence in JDBC.

tim.

> I don't have faith in the JDBC-ODBC bridge (it IS a piece of crap with lot's
> of bugs etc.). Yet, I was surprised to find that the JDBC-ODBC bridge was
> actually much faster than the Merant pure-java thin driver for SQL Server!!
> (very disappointing as I was expecting the performance to be better!) -this
> was the case with Oracle's JDBC drivers also - except that the difference
> was much less. Didn't give me much confidence about the performance of JDBC
> :-((
> 
> Chandika
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Victor A.
> Salaman
> Sent: Wednesday, February 14, 2001 10:53 AM
> To: Orion-Interest
> Subject: RE: VARCHAR values are always the length of the field
> 
> 
> I have some thoughts... don't be cheap and get rid of that piece of crap
> ODBC-JDBC bridge... buy a real jdbc driver.
> 
> - peace -
> Victor!
> 
> -----Original Message-----
> From: Michael S. Kelly [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 2:34 PM
> To: Orion-Interest
> Subject: VARCHAR values are always the length of the field
> 
> 
> Here's the problem, when I get a datasource like this:
> 
>       // Error trapping removed for clarity.
>       Context initCtx = null;
>       initCtx = new InitialContext();
> 
>       String dsName = "jdbc/MSSQLTimecardDS";
>       DataSource ds = initCtx.lookup(dsName);
> 
> and use it to return a ResultSet containing a VARCHAR field, the getString
> method always returns a String containing spaces filling out the String to
> the entire lengthe of the VARCHAR field, i.e. if I have a VARCHAR(50) field
> I get a String 50 characters long regardless of how much text is actually
> stored in the field.
> 
> This does not happen when using a CMP to access the same table and does not
> happen when I create a Connection using a DriverManager instead of a
> DataSource.
> 
> I'm using the ODBC-JDBC bridge against SQL Server.  Here's my DataSource
> definition:
> 
>   <data-source
>      name="MSSQLServerTimecard"
>      location="jdbc/MSSQLCoreTimecardDS"
>      xa-location="jdbc/xa/MSSQLXATimecardDS"
>      ejb-location="jdbc/MSSQLTimecardDS"
>      connection-driver="sun.jdbc.odbc.JdbcOdbcDriver"
>      url="jdbc:odbc:Timecard"
>      username="sa"
>      password=""
>      inactivity-timeout="30"
>      class="com.evermind.sql.DriverManagerDataSource"
>   />
> 
> and my database-schema mappings:
> 
> <database-schema name="Microsoft SQL Server" not-null="not null" null=""
> primary-key="primary key">
>       <type-mapping type="java.lang.String" name="varchar (50)" />
>       <type-mapping type="float" name="float" />
>       <type-mapping type="double" name="float" />
>       <type-mapping type="byte" name="smallint" />
>       <type-mapping type="char" name="char" />
>       <type-mapping type="short" name="int" />
>       <type-mapping type="boolean" name="bit" />
>       <type-mapping type="long" name="int" />
>       <type-mapping type="java.io.Serializable" name="varbinary" />
>       <type-mapping type="java.sql.Timestamp" name="datetime" />
> 
>       <disallowed-field name="password" />
>       <disallowed-field name="username" />
>       <disallowed-field name="date" />
>       <disallowed-field name="text" />
> </database-schema>
> 
> I've tried changing the mapping to String to "varchar" (leaving out size
> parameter), but this didn't help.  Any thoughts?
> 
> -=michael=-


Reply via email to