Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 794111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:15:49+00:00 2026-05-14T22:15:49+00:00

I am currently working on an application named BlackBerry Contacts Sync and I am

  • 0

I am currently working on an application named BlackBerry Contacts Sync and I am stuck at this point on how to sync Contact’s Image. How can images be stored in the database (MySQL) and how to retrieve them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:15:50+00:00Added an answer on May 14, 2026 at 10:15 pm

    If you want to store your images in the database instead of just a path to reference the image, the column that will hold your image need to be of BLOB type.

    CREATE TABLE upload (
        id INT NOT NULL AUTO_INCREMENT,
        name VARCHAR(30) NOT NULL,
        content LONGBLOB NOT NULL,
        PRIMARY KEY(id)
    );
    

    From your BlackBerry program (warning, untested):

    //First param is a Bitmap, second is quality
    JPEGEncodedImage encodedImage = JPEGEncodedImage.encode(image, 100);
    byte imageBytes[]=encodedImage.getData();
    
    //The HTTP connection stuff
    HttpConnection conn = (HttpConnection) Connector.open(SERVER_URL, Connector.READ_WRITE);
    conn.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE, HttpProtocolConstants.CONTENT_TYPE_MULTIPART_FORM_DATA);
    conn.setRequestMethod(HttpConnection.POST);
    conn.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(imageBytes.length));
    //Change this part to what your server side code expects
    String contDisp="Content-Disposition:form-data; uploadedimage=YOUR_IMAGE_NAME;filename=\"Image.jpg\"";
    String contEnc = "Content-Transfer-Encoding: binary";
    String type="Content-Type:image/jpeg";
    
    OutputStream out= conn.openOutputStream();
    out.write(imageBytes);
    out.flush();
    out.close();
    

    So basically you use HttpConnection to setup the headers for a POST request, with multipart form data as content type. There are other headers that may be needed, to know exactly what you need (not BlackBerry specific) check the HTTP/1.1 protocol specification.

    How to actually store the image into the database will depend on your server side implementation. This can be anything from PHP, ASP, JSP or any server side technology that allows you to talk to your MySQL instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an iOS application where you can take an image and
I'm currently working on an iphone application. I started working on this from a
Currently I am working on a multi-process desktop application on Windows. This application will
Am currently working on an application that requires users to submit posts and comments
I am currently working on an application in VB.NET im my spare time and
I'm currently working in an application that has to navigate a webpage and recollect
I am currently working on an application that has different permissions/users for the local
I'm currently working on an application that allows people to schedule Shows for an
I'm currently working on an application written in C#, which I'm embedding IronPython in.
I am currently working on an application that allows reverse geocoding using silverlight +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.