Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,258 members, 7,807,889 topics. Date: Wednesday, 24 April 2024 at 09:53 PM

How Do I Create A Java App That Works With A Relational Database? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How Do I Create A Java App That Works With A Relational Database? (1198 Views)

A Java App Developer Should Please Help / Relational Database Vs Nosql Database. / Is It That MTN Developers Don't Understand Relational Operators? (2) (3) (4)

(1) (Reply) (Go Down)

How Do I Create A Java App That Works With A Relational Database? by eaglejay13(m): 6:03am On Feb 22, 2016
Please any help?
Re: How Do I Create A Java App That Works With A Relational Database? by larisoft: 8:45am On Feb 22, 2016
Ur question is not clear enough. But if u re writing a java web app, there is mysql and jbdc. If its desktop, look into h2 db.

1 Like

Re: How Do I Create A Java App That Works With A Relational Database? by lekropasky(m): 1:36pm On Feb 22, 2016
Make you question Clearer. I might be able to help.
Re: How Do I Create A Java App That Works With A Relational Database? by DonSegmond(m): 2:37pm On Feb 22, 2016
You use a database driver to connect to the database.
Every database has a host, a name, a username and password.
Once you use that driver to connect, this is a psuedo example

dbConnection = dbConnect("host", "dbname", "dbuser", "dbpassword" ) ;

You will have your connection, then using that connection you can query the database.

queryResults = dbConnection.query("SELECT first_name, last_name FROM mytable" ) ;

rows = queryResults.fetchAll() ;

foreach (rows as r) {
print("Name " + r.first_name + " " + r.last_name + "\n" ) ;
}

then when you are done, you close the connection
dbConnnection.close() ;

This is how it works with pretty much every langauge, java, python, php, ruby, c

You must find what database driver you are going to use and study it very well.

Here is how to use Java and MySQL.
http://zetcode.com/db/mysqljava/

If you are using MSQL, PostgresSQL or Oracle, it will be a bit different, but not much.

Best of luck.

1 Like 1 Share

Re: How Do I Create A Java App That Works With A Relational Database? by eaglejay13(m): 4:26pm On Feb 22, 2016
Tnx all, you guys have helped me so much.
Re: How Do I Create A Java App That Works With A Relational Database? by eaglejay13(m): 4:33pm On Feb 22, 2016
Tnx a bunch @DonSegmond
Re: How Do I Create A Java App That Works With A Relational Database? by lekropasky(m): 7:51pm On Feb 22, 2016
If you plan to develop a Desktop application, i guess you should try and research about Databases that support Embedded Driver such as Java DB. For if you use Mysql your database can only be accessed through an internet server which i think might not be suitable for a standalone Desktop Application. So, it solely depends on the type of the application you want to develop. And if you need guideline to how you'll perform database manipulations, Google is your friend. If you are using Java, then search for ''Java JDBC tutorial''. This should get you On....

Happy Coding.

1 Like

(1) (Reply)

Programming With Excel VBA / Facebook Pays $10,000 To 10-year-old Instagram Hacker / How To Publish Post On Your Sites Using OPERA-MINI Browser

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.