ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » PASSTHRU Database BLOB - Help needed

Post new topic  Reply to topic
 PASSTHRU Database BLOB - Help needed « View previous topic :: View next topic » 
Author Message
kayhansefat
PostPosted: Mon Oct 01, 2007 2:19 am    Post subject: PASSTHRU Database BLOB - Help needed Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Hi I have a database table (DB2) that I am creating a new record in from a Java Compute Node. I can successfully write a new record to the table with VarChar, Char data types etc. But I am having trouble trying to convert a String to a BLOB then write it to the appropriate field:

Code:
String dat = "hello";
byte[] datByteArray = dat.getBytes();

MbSQLStatement state = createSQLStatement("IETESTDB", "PASSTHRU('INSERT INTO STD_REQUEST (DAT) VALUES (" + datByteArray + ")';") ;


When the code is executed an SQL0104N Error states that

Quote:
An unexpected token "[" was found following "_TEST (DAT) VALUES("


Am I creating the BLOB in the correct way and passing it through correctly? Thanks
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Mon Oct 01, 2007 2:23 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Just a note that IF the DAT field was a varchar:

MbSQLStatement state = createSQLStatement("IETESTDB", "PASSTHRU('INSERT INTO STD_REQUEST (DAT) VALUES (''" + dat + "'')';") ;

Would perform successfully (notice the two single quotes around each side of the "dat" variable).
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Tue Oct 02, 2007 4:29 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Any ideas how to pass a string in Java to a BLOB database field using Passthru guys?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » PASSTHRU Database BLOB - Help needed
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.