We recently change our application from Sun JDBC-ODBC
bridge driver to MS SQLServer JDBC driver and one of our
functionality is failing and after debuging dound that
getByte mentod is not retrving the data correctly rather
it change the data. The code is working fine with JdbcOdbc
driver, here is the sample code.
Any help is appreciated.
Thanks
Syed
stmt = objUtil.getConnection().createStatement();
result = stmt.executeQuery(strSQL);
byte[] gbArrKS = null;
while (result.next()){
gbArrKS= result.getBytes("BinrydataCol");
}
Hi. You'll get your best help if you describe the definition of the table
column, and maybe also show what the data really is.
thanks,
Joe Weinstein at BEA
Syed Hussain wrote:
> We recently change our application from Sun JDBC-ODBC
> bridge driver to MS SQLServer JDBC driver and one of our
> functionality is failing and after debuging dound that
> getByte mentod is not retrving the data correctly rather
> it change the data. The code is working fine with JdbcOdbc
> driver, here is the sample code.
> Any help is appreciated.
> Thanks
> --
> Syed
> stmt = objUtil.getConnection().createStatement();
> result = stmt.executeQuery(strSQL);
> byte[] gbArrKS = null;
> while (result.next()){
> gbArrKS= result.getBytes("BinrydataCol");
> }
>
sql
Showing posts with label getbytes. Show all posts
Showing posts with label getbytes. Show all posts
Wednesday, March 21, 2012
GetBytes issue
Labels:
application,
database,
driver,
failing,
getbytes,
jdbc,
jdbc-odbcbridge,
microsoft,
mysql,
oracle,
ourfunctionality,
server,
sql,
sqlserver,
sun
GetBytes
I'm creating an array of SqlParameters to send to SqlCommand.
Every parameter has to have a size, or I get an error.
Would it be efficient to get the bytes of every Object (parameter value) and pass it to the array?
What about truncation?
Does someone know a better method of doing this?
You can get length of all parameters using SqlCommandBuilder.DeriveParameters function. For more information you see http://www.davidhayden.com/blog/dave/archive/2006/11/01/SqlCommandBuilderDeriveParameters.aspx
Subscribe to:
Posts (Atom)