Home > Archive > SQL Server JDBC > January 2006 > can i use setString() for a text type column in the prepareStateme









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author can i use setString() for a text type column in the prepareStateme
setString()

2005-12-08, 3:23 am

can i use setString() for a text type column in the prepareStatement sql?Like
this:
create table cmm(test text);
PreparedStatement pstmt = null;
String sSql = "insert into cmm(test) values(?)";
pstmt = conn. prepareStatement(sSq
l);
pstmt.setString(1, "test");
pstmt.executeUpdate();
pstmt.close();

Kamil Sykora [MSFT]

2006-01-12, 11:23 am

Hello,

I was able to use the code below with both the 2000 and 2005 Beta2 drivers.
Are you seeing an exception?

Thanks,
Kamil

Kamil Sykora [MSFT]
Microsoft Developer Support - Webdata

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.
--------------------
| From: "=?Utf-8?B?c2V0U3RyaW5nKCk=?="
< setString()@discussi
ons.microsoft.com>
| Subject: can i use setString() for a text type column in the
prepareStateme
| Date: Wed, 7 Dec 2005 22:52:02 -0800
|
| can i use setString() for a text type column in the prepareStatement
sql?Like
| this:
| create table cmm(test text);
| PreparedStatement pstmt = null;
| String sSql = "insert into cmm(test) values(?)";
| pstmt = conn. prepareStatement(sSq
l);
| pstmt.setString(1, "test");
| pstmt.executeUpdate();
| pstmt.close();
|
|

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com