This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Date Type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Date Type" Watch "Date Type" New topic

Date Type

sandy yang

Joined: Jan 26, 2001
Posts: 8
I using MS SQL Server's Northwind database as my simple database,
I try to display information form Employees table, the data type is "TEXT" for employee's name in SQL Server. My question is: What's the matching java type for it? when I use resultSet.getObject, the program runs, and the column is blank, no employee's name will display. when I use ResultSetMetaData.getColumnTypeName, I get the data is "nvarchar". I can't find the matching java data type for it.
David Freels
Ranch Hand

Joined: Feb 01, 2001
Posts: 102
Try using resultSet.getString. The Oracle JDBC driver has problems with the getObject method so maybe your driver does as well.

I was just informed by a SQL Server admin that the nvarchar is a UNICODE field.
Hope this helps.
[This message has been edited by David Freels (edited March 09, 2001).]
Consider Paul's rocket mass heater.
subject: Date Type
Similar Threads
Java noob -- sentinel-controlled while loop
Problems changing foreign key references in Grails?
Could not parse configuration: /hibernate.cfg.xml
stuck up in the problem