I need some guidance on how to retrieving data from a database. The database is called Drug Combination DataBase and so far I'm just using a small text file that contains a small portion of the data, but the complete database is available as a 14mb sql-file. Can I load this in an efficient way during run-time in my java application so I can look up a few entries? I've never used an sql-file to retrieve data in java before so I don't know what is the best strategy. By the way, I'm creating an application that reads large graphs and another xml database so memory usage is fairly high.
-
What do you mean by "sql file?" The way you handle this is different if it's a CSV, Sqlite db, or Mysql flat file.David Ehrmann– David Ehrmann2016-10-08 22:22:26 +00:00Commented Oct 8, 2016 at 22:22
-
I'm referring to the contents of the DCDB.zip at this page: DCDB2 download pageuser1171426– user11714262016-10-08 22:36:47 +00:00Commented Oct 8, 2016 at 22:36
-
Looks like they also provide a tab-separated version, so the answer will depend a lot on how you plan to use the data. Is this a one-time thing, or for a system you're going to query?David Ehrmann– David Ehrmann2016-10-09 00:02:08 +00:00Commented Oct 9, 2016 at 0:02
-
I need to retrieve data each time a user uploads, creates or changes graphs which will happen multiple times while the app is running.user1171426– user11714262016-10-09 11:44:35 +00:00Commented Oct 9, 2016 at 11:44
Add a comment
|
1 Answer
the way to connect a Java program to a database is through JDBC. the file needs to be read int and saved to a database like MySQL or PostgresQL in order to be accessed. check out this link for a good tutorial: jdbc tutorial