Thursday, October 25, 2012

what is database


What is Database

I am trying to use a database to store all my data using Java. I have created a class DatabaseManager which will open, create/delete , and insert into the database. Which is the best way to manage the connection?

What is Database

public class DatabaseManager { public DatabaseManager() { // Initialize the database which opens the database try{ }catch{ }finally{ //finally close the database } } public boolean insertData() { //Insert the data } } The DatabaseManager is called from a singleton object i am getting an object Database is closed. What is the best way to open and close a database connection?

"i am getting an object Database is closed." Where? Where is Database used? It's nowhere in the code you've quoted. What you you tried? Have you looked up the basics of database connections in Java? (There's no shortage of information available on that.) – T.J.

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
 

No comments:

Post a Comment