in Education by
what is the easiest way to convert a Blob into a byte array?I am using MYSQL and i want to convert a Blob datatype into a byte array. Iam using java programming language:) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
the mySql blob class has the following function : blob.getBytes use it like this: //(assuming you have a ResultSet named RS) Blob blob = rs.getBlob("SomeDatabaseField"); int blobLength = (int) blob.length(); byte[] blobAsBytes = blob.getBytes(1, blobLength); //release the blob and free up memory. (since JDBC 4.0) blob.free();

Related questions

0 votes
    what is the easiest way to convert a Blob into a byte array?I am using MYSQL and i want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    How do we convert a byte array to a hexadecimal string, and vice versa?...
asked Jan 16, 2021 in Technology by JackTerrance
0 votes
    What's the best way to extract the key and value from a string like this: var myString = 'A1234= ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 9, 2022 in Education by JackTerrance
0 votes
    I want to make a copy of an ActiveRecord object, changing a single field in the process (in addition ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I want to make a copy of an ActiveRecord object, changing a single field in the process (in addition ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have a java object with several members. I want to create a small, quick and dirty editor that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I have a java object with several members. I want to create a small, quick and dirty editor that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I want to convert an int to a byte[2] array using BCD. The int in question will come from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    My application is receiving email through SMTP server. There are one or more attachments in the email and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    My application is receiving email through SMTP server. There are one or more attachments in the email and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    My application is receiving email through SMTP server. There are one or more attachments in the email and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    Which of these method of DatagramPacket is used to obtain the byte array of data contained in a datagram? ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these methods of DatagramPacket is used to find the length of byte array? (a) getnumber() ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Is there a better way than this to splice an array into another array in javascript var string = ' ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
...