Hi, Can I make an Object3D from a database information, I mean, I want to save all the 3ds files and textures on a database as blob and reconstruct them to use them in jpct. I have no idea about this, any clues?
You need some tool to read the files and write them into the blob and vice versa. That should be sufficient. Depending on the database, blobs can be a bit tricky (on Oracle for example). However, what's the purpose of this? Personally, i wouldn't do this. I once did that myself with graphics, but i found it too cumbersome to use. I wouldn't do it again that way but simply store a reference to the file on the hard disc in the DB instead.
The requirements of the project is that the 3d models have to be stored on a database and not as files in the server for security, but I guess I can save the file on non user visible folders on my web server. Maybe sme requirements have to be changed in order to achieve quickly the project.
It isn't that hard to write some code that reads/writes blobs. If the project requires it, then so be it. Which database server is that?
It will be mysql 4.x.
MySQL should be fine when dealing with blobs. At least i can't remember having any issues with it regarding blobs.
This sounds interesting. Any chance I can see the source code when you finish this?
Pray for me to finishing it becausse I am not finishing my projects this days, jaja. I will try a bit to do it but if not I will better place the file on specific folders.
Quote from: Melssj5 on July 16, 2008, 02:19:48 AM
Pray for me to finishing it becausse I am not finishing my projects this days, jaja. I will try a bit to do it but if not I will better place the file on specific folders.
LOL, np
well I was thinking on serializing the object3d and saving it into a file then getting the file and reading its bytes and saving the array in the database, and viceversa. But I am doing unnecesary reads and writes from the harddisc. How can I get an object converted to a byte array?
I was checking the ByteArrayStreams and the StringBufferStreams with no luck.
there should be a way in the jdbc to do an insert of an Object directly.
Hi, I found this. Very interesting, at least for me.
A record can be inserted directly to the database using the Resultet and the insertRow method.
should be something like that:
1.- getting the ResultSet rs
2.- rs.moveToInsertRow();
3.- rs.updateObject(int columnIndex, Object x, int scale)
4.- calling to rs.insertRow ()
This should insert the object on the database. I will try it by tomorrow becausse I must go home before I got stabbed. If anyone have try it please post it.