Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointer exception for MSSQL database (SQLServerDatabaseMetaData.java:287)

 
prashant shelke
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing following exception stack-trace when I tried to call getColumns() method on
java.sql.DatabaseMetaData object ( which I retrieved from MSSQL's JDBC connection)


Exception:

java.lang.NullPointerException
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetWithProvidedColumnNames(SQLServerDatabaseMetaData.java:287)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getColumns(SQLServerDatabaseMetaData.java:547)

I am sure about attributes are Not NULL which I am sending to getColumns method. Not getting what causing this exception.

MSSQL server version I am using:
Microsoft SQL Server Management Studio Express 9.00.2047.00
Microsoft Data Access Components (MDAC) 2000.085.1117.00 (xpsp_sp2_rtm.040803-2158)
Microsoft MSXML 2.6 3.0 5.0 6.0
Microsoft Internet Explorer 8.0.6001.18702
Microsoft .NET Framework 2.0.50727.42
Operating System 5.1.2600


Please help if anybody aware of this.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which driver are you using?
 
prashant shelke
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using sqljdbc4.jar, I looked into its MANIFEST.MF but its not having version number mentioned in it.

Following are parameters for getColumns() method:

getColumns(DatabaseName, null, TableName, "%")

Here, owner name I am sending as "null"

Thanks for reply.
 
prashant shelke
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue resolved by changing

getColumns(database name, null, table name, "%")

to

getColumns(database name, null, table name, null)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic