This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I need some guidance with handling clob data. I have a derby table:
Hashes and salts are generated like this:
Then records are stored like this:
This bit works fine. At least I am convinced so.
Once I store the digests in a DB I use this method to compare them:
Hash and salt arguments being passed to the compareHashes() are the ones retrieved from a database with:
and also:
Clearly I am doing something wrong with getting data from Clobs. And this:
is the only way I coud come up with to convert the clob back to array, which isn't working like i would like it to. I thought byte[] arrays passed were binary and since clobs are? also binary it would work with out additional conversions.
Do any of you have any ideas/suggestions/libraries which would be able to convert the clobs to what I want?
I was under the impression that blobs were for files like media files or pictures? Also I am not able to insert to Blob type fields things like: 81-88108101-39-95348102-413-2318-44-95-4029-92-11-53115-124-89-89080-102126888411531
because an exception is being thrown:
Philip Fry wrote:I was under the impression that blobs were for files like media files or pictures? Also I am not able to insert to Blob type fields things like: 81-88108101-39-95348102-413-2318-44-95-4029-92-11-53115-124-89-89080-102126888411531
because an exception is being thrown:
Blobs are -- just as their name says -- Binary Large Objects. It's true that the files you mention are binary and can be large, but it doesn't follow from that statement that you can't use Blobs for anything else.
And no, you can't put character data into them. You have to put bytes into them. Naturally you can't do that if you're constructing your SQL statements in a String (I can't believe you're doing all of this login security and then using a technology which is susceptible to SQL injection attacks). You can put bytes into them if you use a PreparedStatement and then use its setBlob() or setBinaryStream() method.
Philip Fry
Greenhorn
Joined: Sep 21, 2011
Posts: 6
posted
0
Thank you very much good sir.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.