Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Connection to SQL Server 2000 throws IndexOutOfBoundsException???? help???

3 views
Skip to first unread message

Christien Lomax

unread,
Apr 5, 2001, 1:46:29 PM4/5/01
to
Hey,

If anyone could give me a hint, it would be appreciated...

I have a class that is responsible for getting a connection to the
Database.. below is a snippit from the class... The problem is, it always
throws an IndexOutOfBoundsException when it trys to execute the
DriverManager.getConnection( url, username, password ); ... Anyone know
why? The DB is an SQL Server 2000 db on the local network ( machine named
EMPLOYEE, database named vpr_old, port is 1433 (I checked). The driver is
in the classpath.

Anyone? (please post relies to this group)


--- CODE: -----------------------------------------------------------------

public Connection getConnection() throws SQLException
{
try
{
Connection con = null;
Class.forName( "com.ashna.jturbo.driver.Driver" );
String url = "jdbc:JTurbo://EMPLOYEE:1433/vpr_old";
String username = "sa";
String password = "";
System.out.println( " .. DBC: got url [ " + url + " ] " );
System.out.println( " .. DBC: got username [ " + username + " ] " );
System.out.println( " .. DBC: got password [ ********** ] " );
con = DriverManager.getConnection( url, username, password );
System.out.println( " .. DBC: got connection " );
return con;

}
catch( SQLException ex )
{
ex.printStackTrace();
throw new SQLException( ex.getMessage() );
}
}


--- OUTPUT IS: ------------------------------------------------------------

.. DBC: got url [ jdbc:JTurbo://EMPLOYEE:1433/vpr_old ]
.. DBC: got username [ sa ]
.. DBC: got password [ ********** ]
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStream.java:280)
at com.ashna.jturbo.tds.I.d(I.java, Compiled Code)
at com.ashna.jturbo.tds.I.a(I.java, Compiled Code)
at com.ashna.jturbo.tds.I.a(I.java)
at com.ashna.jturbo.tds.I.j(I.java)
at com.ashna.jturbo.tds.h.a(h.java)
at com.ashna.jturbo.driver.w.a(w.java)
at com.ashna.jturbo.driver.w.execute(w.java)
at com.ashna.jturbo.driver.w.executeUpdate(w.java)
at com.ashna.jturbo.driver.c.<init>(c.java)
at com.ashna.jturbo.driver.Driver.a(Driver.java)
at com.ashna.jturbo.driver.Driver.connect(Driver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at
com.pictorius.db.DBConnectionUtil.getConnection(DBConnectionUtil.java:83)


--
Christien Alexander Lomax


Konstantin Gordiyenko

unread,
Apr 6, 2001, 4:31:39 PM4/6/01
to
java.io.BufferedInputStream.read throws IndexOutOfBoundsException only
if it called with incorrect arguments. It means that there is a bug in
JDBC driver you're using. Contact driver vendor support.
konstantin.vcf
0 new messages