次のように setBlob() を使用しようとしました:
class DataBuf : public streambuf
{
public:
DataBuf(char * d, size_t s) {
setg(d, d, d + s);
}
};
char b[20];
DataBuf buffer((char*)b, 20);
istream stream(&buffer);
PreparedStatement* s = con->PrepareStatement("insert into mytable (mybin) values (?)");
s->setBlob(1, &stream);
int rows = s->executeUpdate();
これは executeUpdate() でクラッシュします。私は何を間違っていますか?