I have a java application with embedded H2 database.

The H2 database library is said to be written completely in java. So there must be an object oriented equivalent for SQL statements like 'SELECT * FROM TABLE TESTTABLE' just like Table.select('*') etc...

Or is there any simple easy to use object oriented database library for java? As i'm developing a small application for registering book names, authors names, genres list etc... for a book library, speed is not a big concern.

有帮助吗?

解决方案

H2 is fundamentally an RDBMS (Relational Data Base Management System), so it's absolutely not "object oriented". It happens that its implementation is written with an object oriented language, namely Java, but it has strictly no consequence on its concepts.

That would similar to think that as you used a steel tool to shape a hammer in wood, the hammer is indeed steel...

As mentioned fge in its comment, to manipulate your database, currently managed by H2, in an object fashion, you need a specific library named ORM (for Object-Relational Mapping), for example http://www.hibernate.org/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top