Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. storing image to Database

storing image to Database

Scheduled Pinned Locked Moved Database
databasesql-serversysadminquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ajith P T
    wrote on last edited by
    #1

    hi all, how can i store the image file(.jpg,.gif,.bmp etc) to database. i am using SQl Server 2000. what will be the datatype of the field thank you all

    T 1 Reply Last reply
    0
    • A Ajith P T

      hi all, how can i store the image file(.jpg,.gif,.bmp etc) to database. i am using SQl Server 2000. what will be the datatype of the field thank you all

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      type : binary. works fine for me for jpg, jpg, bmp and so...


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      T C 2 Replies Last reply
      0
      • T toxcct

        type : binary. works fine for me for jpg, jpg, bmp and so...


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        T Offline
        T Offline
        thealca
        wrote on last edited by
        #3

        How do u store it programmatically, I am using VB 6.0 / .Net for example? :doh:

        T 1 Reply Last reply
        0
        • T toxcct

          type : binary. works fine for me for jpg, jpg, bmp and so...


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          C Offline
          C Offline
          chuotcoikeo
          wrote on last edited by
          #4

          Why are use type data is image

          T 1 Reply Last reply
          0
          • C chuotcoikeo

            Why are use type data is image

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            sorry, maybe my englishis too poor to understand yours... but i'd like you to reformulate your query please...


            TOXCCT >>> GEII power
            [toxcct][VisualCalc]

            1 Reply Last reply
            0
            • T thealca

              How do u store it programmatically, I am using VB 6.0 / .Net for example? :doh:

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              actually, i did it wihin a java code, but the server was a SQL Server 2000. do you want it nevertheless ?


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              A 1 Reply Last reply
              0
              • T toxcct

                actually, i did it wihin a java code, but the server was a SQL Server 2000. do you want it nevertheless ?


                TOXCCT >>> GEII power
                [toxcct][VisualCalc]

                A Offline
                A Offline
                Anonymous
                wrote on last edited by
                #7

                If you don't mind yes, I'm also coding in java more basics only Thank You.

                T 1 Reply Last reply
                0
                • A Anonymous

                  If you don't mind yes, I'm also coding in java more basics only Thank You.

                  T Offline
                  T Offline
                  toxcct
                  wrote on last edited by
                  #8

                  if (getPicture() != null) {
                  ByteArrayInputStream inStream;
                  inStream = new ByteArrayInputStream(getPicture());
                  rqt.setBinaryStream(1, inStream, inStream.available());
                  // Where rqt is a PreparedStatement
                  }

                  in my bean :

                  private byte\[\] picture;
                  
                  public byte\[\] getPicture() {
                      return picture;
                  }
                  

                  TOXCCT >>> GEII power
                  [toxcct][VisualCalc]

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups