31.8.09
JavaDB/Derby: Worthy to Have a Try!
Originally, I was looking for an embedded Java database. JavaDB could work in an embedded style, but with 2M limitation. That's terrible. However, since I can control JavaDB server within my Java application, I run the server with a random server port, then connect to it within the same program. Now, my database looks like an embedded one but with no limitation on size. Additionally, JavaDB is much more faster than SQLite3.
30.8.09
27.8.09
Embedded DB within Java using Derby/JavaDB
Reference: http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javadb/
1. Download JavaDB from
http://developers.sun.com/prodtech/javadb/downloads/
or Apache Derby site.
2. Copy derby.jar to your runtime environment
3. Create a JDBC connection to an embedded Derby DB using code similar to the following:
String dbName = "testDb";
Properties props = new Properties();
props.put("user", "testuser");
props.put("password", "testpass");
conn = DriverManager.getConnection("jdbc:derby:" + dbName
+ ";create=true", props);
Note that within Java 6/JDBC 4, you don't need to call Class.forName() explicitly to load the JDBC driver.
4. Nothing else. Enjoy it!
Labels:
Derby,
Embedded DB,
JavaDB,
JDBC 4
The new created file permission within cygwin is always wrong!
It's always being 000.... I still don't know what happen with my cygwin. I checked unmask, and found it was set properly as 022. What's wrong?
24.8.09
Domain User to Use Cygwin
It's the first time I encounter this.
When I started the bash shell for cygwin in my office using my Laptop, I found some extra message that telling me that the passwd/group file should be rebuilt using mkpasswd -l and mkgroup -l. I tried it but the same message show again. Finally I found there should be a -d parameter there because I'm a domain user in my Office. So I did, and everything works fine.
Subscribe to:
Posts (Atom)