Sorry, premature posting...
I think you are confusing the capabilities of an IDE with those of the
application that the IDE builds. First of all, your program (not JCreator)
will have to serialize the object(s). For this, your classes will have to
implement the Serializable interface. To serialize the object, you can use
something like this:
byte[] data;
try
{
ByteArrayOutputStream out = new ByteArrayOutputStream();
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeObject(project);
s.flush();
s.close();
data = out.toByteArray();
out.close();
}
catch (Exception e) { System.out.println(e); }
Once you have the byte array that represents the "freeze-dried" object, you
can save it in the database as a BLOB. This part can be done using the JDBC.
To get the object back from the database, you will have to repeat the above
process in reverse:
1. Use the JDBC to fetch the BLOB from the database and get its binary
content
as a byte array. The details will vary from one DB to another; you will need
to consult the database docs on this. Here is an example for MS SQL Server
2000 JDBC driver:
resultSet = statement.executeQuery(sqlCommand);
try
{
return (rs.getBytes(col));
}
catch (Exception e)
{
System.out.println(e);
return null;
}
2. Deserialize the byte array into an object:
try
{
ByteArrayInputStream in = new ByteArrayInputStream(data);
ObjectInputStream s = new ObjectInputStream(in);
object = s.readObject();
s.close();
in.close();
}
catch (Exception e)
{
System.out.println(e);
}
You should do some reading on JDBC and Java IO to better understand what the
code snippets do.
The IDE has nothing to do with this process.
HTH
Alex Molochnikov
'Gestalt Corporation
<a rel="nofollow" style='text-decoration: none;' href="http://www.gestalt.com" target="_blank">www.gestalt.com</a>
"BoraT" wrote in message
> I am new to programming, but I know how to create classes and other
> minor things. I use JCreator 2.5 LE.
> I was wandering on a thing: I want the data i create(object and other
> things) to be saved in some files, that when i run the java prog again
> I would have an already created objects with the attributes that i
> gave them. And when i make changes in the objects(e.g. change the
> name) it will be saved too.
>
> So the question is: how to create a database that can be used with
> JCreator 2.5 LE?
>
> Thanks in advance!
>
> --
> <a rel="nofollow" style='text-decoration: none;' href="http://www.dbForumz.com/" target="_blank">http://www.dbForumz.com/</a> This article was posted by author's request
> Articles individually checked for conformance to usenet standards
<font color=purple> > Topic URL: <a rel="nofollow" style='text-decoration: none;' href="http://www.dbForumz.com/Java-db-help-ftopict182736.html</font" target="_blank">http://www.dbForumz.com/Java-db-help-ftopict182736.html</font</a>>
> Visit Topic URL to contact author (reg. req'd). Report abuse:
<a rel="nofollow" style='text-decoration: none;' href="http://www.dbForumz.com/eform.php?p=615454" target="_blank">http://www.dbForumz.com/eform.php?p=615454</a>
>> Stay informed about: Java db help