25 Haziran 2019 Salı

BLOB

Örnek
Açıklaması şöyle.
Notice that the binary literal format on Oracle is different than MySQL. This is another reason that you should avoid using binary literals in SQL statements to make your Java program portable.
Şöyle yaparız.
Statement sta = con.createStatement();

// Inserting CLOB value with a regular insert statement
int count = sta.executeUpdate(
        "INSERT INTO Image"
        +" (ID, Subject, Body)"
        +" VALUES (1, '"+subject+"'"
        +", 'C9CBBBCCCEB9C8CABCCCCEB9C9CBBB')"); //Oracle format
//      +", 0xC9CBBBCCCEB9C8CABCCCCEB9C9CBBB)"); //SQL Server format
//      +", x'C9CBBBCCCEB9C8CABCCCCEB9C9CBBB')"); // MySQL format

Hiç yorum yok:

Yorum Gönder