Re: Driver.getPropertyInfo() returns inconsistent array



Angel,

Great!

I assume the "latest drop" is newer then the driver we've tried with?

Regards

Roger

"Angel Saenz-Badillos[MS]" wrote:

> Thank you for reporting this issue. I have just tried the following code in
> the latest drop of our driver and it looks like it does not have this
> problem.
>
> Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> Driver Driver1 = DriverManager.getDriver("jdbc:sqlserver://");
> DriverPropertyInfo[] infoArray =
> Driver1.getPropertyInfo("jdbc:sqlserver://", new Properties());
>
> System.out.println(infoArray.length);
> for (int i=0;i < infoArray.length ;i++){
> System.out.print("NAME = "+ infoArray[i].name);
> System.out.print(". VALUE = " + infoArray[i].value);
> System.out.println(". DESCRIPTION = " + infoArray[i].description);
> }
>
> output:
> 16
> NAME = user. VALUE = null. DESCRIPTION = User name
> NAME = password. VALUE = null. DESCRIPTION = Password
> NAME = databaseName. VALUE = null. DESCRIPTION = Database to connect to
> NAME = serverName. VALUE = null. DESCRIPTION = The host to connect to
> NAME = portNumber. VALUE = 1433. DESCRIPTION = The SQL Server port
> NAME = sendStringParametersAsUnicode. VALUE = true. DESCRIPTION = Send
> prepared string parameters as Unicode
> NAME = applicationName. VALUE = Microsoft SQL Server 2005 JDBC Driver.
> DESCRIPTION = Set the application name for profiling
> NAME = lastUpdateCount. VALUE = true. DESCRIPTION = Ensure that only the
> last update count from an update or insert is returned
> NAME = disableStatementPooling. VALUE = true. DESCRIPTION = Disable
> statement pooling
> NAME = integratedSecurity. VALUE = false. DESCRIPTION = Integrated security
> NAME = lockTimeout. VALUE = -1. DESCRIPTION = Set the lock timeout
> NAME = loginTimeout. VALUE = 0. DESCRIPTION = Set the login Timeout
> NAME = instanceName. VALUE = null. DESCRIPTION = Set the Instance Name
> NAME = xopenStates. VALUE = false. DESCRIPTION = Set the SQLException state
> to XOPEN mode
> NAME = selectMethod. VALUE = direct. DESCRIPTION = Enable Serverside cursors
> NAME = workstationID. VALUE = null. DESCRIPTION = Host name of the
> workstation
> --
> Angel Saenz-Badillos [MS] DataWorks
> This posting is provided "AS IS", with no warranties, and confers no
> rights.Please do not send email directly to this alias.
> This alias is for newsgroup purposes only.
> I am now blogging: http://weblogs.asp.net/angelsb/
>
>
>
>
> "roger" <roger@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:E0EBBDE9-4EFA-4AEF-AFF6-D125D51F07FA@xxxxxxxxxxxxxxxx
> > Hi,
> >
> > We are testingn our DbVisualizer tool with:
> >
> > Microsoft SQL Server 2005 JDBC Driver - Beta 2
> > Version: 1.0.419.102
> >
> > The problem is that Driver.getPropertyInfo() method seems to return
> > an array with less elements then being reported by the length attribute.
> > Looping over the array using its length results in a NullPointerException
> > if not checking that the actual value is not null.
> >
> > Our tests shows that length reports 25 while there are only 17 elements
> > in the array.
> >
> > It is easily fixed on our side but I thought you might be interested in
> > knowing this.
> >
> > Regards
> >
> > Roger Bjärevall
> > Minq Software
>
>
>
.