Click here to Skip to main content
15,892,746 members
Home / Discussions / Java
   

Java

 
QuestionConverting Wav file to MP3 or other format Pin
manojnovpandey21-Jun-13 2:25
manojnovpandey21-Jun-13 2:25 
AnswerRe: Converting Wav file to MP3 or other format Pin
NotPolitcallyCorrect21-Jun-13 2:37
NotPolitcallyCorrect21-Jun-13 2:37 
QuestionPlease help me to solve “fix control's position in GridBagLayout” Pin
Bee cute21-Jun-13 1:40
Bee cute21-Jun-13 1:40 
Questionrecent file list Pin
Member 1009379520-Jun-13 23:45
Member 1009379520-Jun-13 23:45 
AnswerRe: recent file list Pin
Richard MacCutchan21-Jun-13 2:21
mveRichard MacCutchan21-Jun-13 2:21 
QuestionHow to displayed a yield in jtable? Pin
tolulan20-Jun-13 5:00
tolulan20-Jun-13 5:00 
AnswerRe: How to displayed a yield in jtable? Pin
Richard MacCutchan20-Jun-13 7:02
mveRichard MacCutchan20-Jun-13 7:02 
QuestionInsert blob from android to oracle Pin
Raditya Kurnianto16-Jun-13 19:36
Raditya Kurnianto16-Jun-13 19:36 
I'm working with Oracle database. I use PHP for my web service and Android as the client which will send blob data to Oracle DB. I use this code

Bitmap imageUpload = BitmapFactory.decodeFile(picturePath);
			ByteArrayOutputStream baos = new ByteArrayOutputStream();
			imageUpload.compress(Bitmap.CompressFormat.JPEG, 60, baos);
			byte[] image_data = baos.toByteArray();
			String converted_image = Base64.encodeBytes(image_data);


to decode and send it as base64 encoding, then send it to the web service with this code

XML
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
                nameValuePairs.add(new BasicNameValuePair("TITLE", title));
                nameValuePairs.add(new BasicNameValuePair("IMAGES", converted_image));
                json = jsonParser.makeHttpRequest(url, "POST", nameValuePairs);



This is my PHP code to insert to oracle db

PHP
if(isset($_POST["TITLE"]) && isset($_POST["IMAGES"]))
    {
        $title = $_POST["TITLE"];
        $image = $_POST["IMAGES"];
        $gambar = file_get_contents($image);

        $query = "INSERT INTO images (TITLE, IMAGES) VALUES (:TITLE, EMPTY_BLOB()) RETURNING IMAGES INTO :IMAGES";
        $parse = oci_parse($connect, $query);

        $lob_a = oci_new_descriptor($connect, OCI_D_LOB);

        oci_bind_by_name($parse, ":TITLE", $title);
        oci_bind_by_name($parse, ":IMAGES", $lob_a, -1, OCI_B_BLOB);
        oci_execute($parse, OCI_DEFAULT);

        if($lob_a->save($gambar))
        {
            oci_commit($connect);
            $lob_a->free();
        }
        else
        {
            oci_rollback($connect);
        }
    }



The PHP code successfully insert the query to the oracle db, but when I see the record the blob does not show anything because the length of the blob is 0. I will appreciate any help. Thank you.
AnswerRe: Insert blob from android to oracle Pin
jschell17-Jun-13 8:12
jschell17-Jun-13 8:12 
AnswerRe: Insert blob from android to oracle Pin
Richard MacCutchan17-Jun-13 21:18
mveRichard MacCutchan17-Jun-13 21:18 
QuestionJava Scanner Pin
User 100606655-Jun-13 22:47
User 100606655-Jun-13 22:47 
AnswerRe: Java Scanner Pin
Richard MacCutchan5-Jun-13 23:34
mveRichard MacCutchan5-Jun-13 23:34 
QuestionHow to send Email using VB 6.0 Pin
Saranya-from-Tamil-Nadu-India4-Jun-13 1:50
Saranya-from-Tamil-Nadu-India4-Jun-13 1:50 
SuggestionRe: How to send Email using VB 6.0 Pin
AlphaDeltaTheta4-Jun-13 5:36
AlphaDeltaTheta4-Jun-13 5:36 
QuestionParallel processing of two methods in main class Pin
Sachin k Rajput 1-Jun-13 0:30
Sachin k Rajput 1-Jun-13 0:30 
AnswerRe: Parallel processing of two methods in main class Pin
Richard MacCutchan1-Jun-13 4:28
mveRichard MacCutchan1-Jun-13 4:28 
QuestionPut and order values in a List Pin
Ghandil31-May-13 8:36
Ghandil31-May-13 8:36 
AnswerRe: Put and order values in a List Pin
Prasad Khandekar3-Jun-13 3:45
professionalPrasad Khandekar3-Jun-13 3:45 
QuestionCipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums31-May-13 6:40
Skippums31-May-13 6:40 
SuggestionRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta31-May-13 21:51
AlphaDeltaTheta31-May-13 21:51 
AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta31-May-13 22:06
AlphaDeltaTheta31-May-13 22:06 
GeneralRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums3-Jun-13 7:26
Skippums3-Jun-13 7:26 
AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums3-Jun-13 7:33
Skippums3-Jun-13 7:33 
SuggestionRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta3-Jun-13 17:05
AlphaDeltaTheta3-Jun-13 17:05 
GeneralRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums4-Jun-13 4:47
Skippums4-Jun-13 4:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.