0

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.

4
  • 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. Commented Oct 8, 2016 at 22:22
  • I'm referring to the contents of the DCDB.zip at this page: DCDB2 download page Commented 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? Commented 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. Commented Oct 9, 2016 at 11:44

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.