Results 1 to 12 of 12

Thread: plz help

  1. #1
    faruk.arshad is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default plz help

    how guys plz tell me how can i convert jar files into bytes.....

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: plz help

    Quote Originally Posted by faruk.arshad View Post
    how guys plz tell me how can i convert jar files into bytes.....
    Do not multipost the same question in the forum. Please re-read the forum rules that you agreed to on signing on.

    You're in luck, a jar file is already bytes -- as is every other file on your computer. If this information doesn't help you, please consider supplying more detail on your problem. My link on how to ask smart questions below can give you suggestions on just what information you may wish to supply us with.

  3. #3
    faruk.arshad is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default Re: plz help

    wat if i want to save it in database ....fro tat i have to convert in to bytes ..so wat sort of streaming i should use ..plz supply a sample code :)

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: plz help

    Quote Originally Posted by faruk.arshad View Post
    wat if i want to save it in database ....fro tat i have to convert in to bytes ..so wat sort of streaming i should use ..plz supply a sample code :)
    Please avoid non-standard abbreviations when posting here, and for several reasons. For one, for many folks who read the forum and help in the forum, English is not their first or even second language, and so strange abbreviations may not be understandable by them. For another, programming is an exercise in precision. If you need help, it would be best if you communicated your problem (or solution) in as clear and precise a way as possible.

    Regarding your question, why would you want to store a jar file in a database? Wouldn't you instead store data created by the jar file? This makes little sense. Otherwise if you need to store it, I guess you can do so as a BLOB, but it would seem a great waste to me. You are probably better off explaining your overall problem and not your planned code solution because it smells to me as if better solutions are available.

  5. #5
    javin.paul is offline Member
    Join Date
    Oct 2011
    Posts
    35
    Rep Power
    0

    Default Re: plz help

    Agree with Fubarable , never heard some one storing jar file in database , though know for images or any other resources which we save as BLOB using JDBC. its better to explain the problem you will get more idea and better solution based on experienced people here and that way you will learn better, copying code is not the best way to move ahead.

  6. #6
    faruk.arshad is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default Re: plz help

    Quote Originally Posted by javin.paul View Post
    Agree with Fubarable , never heard some one storing jar file in database , though know for images or any other resources which we save as BLOB using JDBC. its better to explain the problem you will get more idea and better solution based on experienced people here and that way you will learn better, copying code is not the best way to move ahead.
    .


    there is always first time for every thing Mr.javin paul ...yes am using Image data type in database now i wanted to convert jarfile into bytes and insert it into database .....
    basically i have a task to insert jar file in database nd retrive that jar file when i need to use it ..

  7. #7
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    5

    Default Re: plz help

    Why not save the path of the jar file and not the jar file itself. You keep all those file in a folder and retrieve its path when you need it.

  8. #8
    javin.paul is offline Member
    Join Date
    Oct 2011
    Posts
    35
    Rep Power
    0

    Default Re: plz help

    Don't get it wrong Fubarable, but storing JAR file in database instead of file system doesn't go well to me , perhaps you are storing that to provide download link or anything else. Only way I could perceive is that using BLOB and converting JAR into Bytes by reading it from InputStream. you can use JarInputStream and JarOutputStream for reading from and writing to Jar files. look on java.util.jar package also.

    Check this link also you might find discussion helpful for you:
    JarFile/ZipFile from byte array without temp file

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: plz help

    Quote Originally Posted by javin.paul View Post
    Don't get it wrong Fubarable,...
    Did you mean to address this to me or to faruk?

  10. #10
    javin.paul is offline Member
    Join Date
    Oct 2011
    Posts
    35
    Rep Power
    0

    Default Re: plz help

    Nice suggestion, is there any Plus one button to promote this reply, I always like pointer like this which some how doesn't come in mind some time.

  11. #11
    jing-yi is offline Member
    Join Date
    May 2011
    Posts
    35
    Rep Power
    0

    Default Re: plz help

    I disagree with mine0926. If we are able to save jar files in database, why not?

    Instead of storing it as path, we should store jar file inside database as this will ease further CRUD process.

    Unless storing too many jar files in database will provide bottleneck somewhere, else I do not see any point why we should not store jar files in it.

    Regards,
    Jimmy.

  12. #12
    faruk.arshad is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default Re: plz help

    hey jing ,,,, how can i save jar file in database ???? tell me how...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •