views:

134

answers:

6

Hi I am making an ATM console application in C++. I am planning to use a database, my friend suggested to use files. However, I want to use a database like mySql, Oracle or sqlServer express.

Q: Which one of the databases would be more applicable for a C++ application ?

I am also making a second application in java. This is a large library system consisting of hundreds of records. I want to know which database I can use for this application aswell. Is it Oracle, mysql or sqlserver express. I also heard about JDBC. Is it any good ?

Q: Which one of the databases would be more applicable for a large java application ?

Many Thanks

+2  A: 

JDBC is how a Java program will interact with a database.

Oracle and SQL Server Express are roughly on par, functionality-wise:

  • WITH syntax (CTE, Subquery Factoring)
  • Analytic/Ranking/Windowing functionality (ROW_NUMBER, RANK, DENSE_RANK, NTILE)

SQL Server 2005+ has PIVOT/UNPIVOT - Oracle Express is 10g IIRC; Oracle didn't support PIVOT until 11g.

All of the above I just mentioned - not supported by MySQL.

Which one of the databases would be more applicable for a large java application

Java isn't C++, but define "large". SQL Server 2008 R2 Express supports databases up to 10 GB of data; 2005 Express is limited to 5? I believe Oracle Express is limited to 5 GB.

OMG Ponies
A: 

However, I want to use a database like mySql, Oracle or sqlServer express.

Why did your friend suggested to use files and why did you choose a database instead? There are many topics/posts on choosing files or database.

Q: Which one of the databases would be more applicable for a C++ application ?

The type of application should determine the database to use and not the technology (C++ in your case). Choose a db wisely. Listen to expert comments and determine the database based on the nature of your applications. There are a lot of blogs/posts like this.

I also heard about JDBC. Is it any good ?

Yes, when you use Java for your application.

Q: Which one of the databases would be more applicable for a large java application ?

Again, it is the nature of the application which determines the DB to use.

bdhar
+4  A: 

I don't know what the application is, but I'd honestly suggest sqlite unless you really need some of the hard-core features of a relational database. If it's an application that a friend suggested files for, I'm going to guess that you don't.

Advantages:

  • very light
  • doesn't require having something external to the program
  • stores data in single files, which can be moved around.

Disadvantages:

  • not so good if multiple things need access to the same database at the same time
  • does not support all of SQL

sqlite will support hundreds [of thousands, probably] of records just fine. I've only had one issue with it, and that's when I tried to import 5 GB of topographical data into it, and the program I used tried to do it all in memory (not surprisingly, it ended up in swap, and I just had to kill it since it locked). mySQL succeeded at it, though it took all night to do the import).

As for JDBC, that's just the java interface for whatever you happen to be using. It would let you switch what database backend you were using very easily, since everything is abstracted away from the underlying database.

zebediah49
A: 

Any modern DBMSs can meet your need.

For Java application, you can use JDBC or JPA/Hibernate and the motto of them is to make DBMS transparently, you just code and don't care about the DBMS below.

Truong Ha
A: 

I'm guessing that these are assignments, rather than commercial applications?? In which case I would recommend sticking with something simple (sqllite or mysql).

I would say that for an ATM application, transactional integrity is crucial, and I would argue that it is better to use a system you trust to implement that correctly, rather than try and roll your own.

As to which database - the client language is pretty much irrelevant - you can access any of them from most languages. In C++ you can use ODBC in a similar way to JDBC for Java (to abstract your program away from underlying technology).

mySQL does implement transactions (not by default - or has it changed??). Some language frameworks 'break' transactions by automatically committing after any d/b update.

Where the 'bigger' databases excel is in support of many concurrent processes, often trying to update the same data - one of Oracle's big selling points for many years is that 'readers' were never blocked by 'writers', and that 'readers' would always get a consistent view of the data (i.e. a reader would never get a partial update). SQL Server and postgres both support the same.

If you're just doing a single-user / single-threaded demonstration system, then you probably don't have a requirement to use anything larger.

JulesLt