₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,140 members, 8,510,328 topics. Date: Friday, 30 October 2026 at 08:43 AM

Toggle theme

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? (1320 Views)

1 Reply (Go Down)

How Do I Create A Java App That Works With A Relational Database? by eaglejay13(op): 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.
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.
Re: How Do I Create A Java App That Works With A Relational Database? by eaglejay13(op): 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(op): 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 Reply

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

How To Generate a Bar code Using Excel • 2017 Whatsapp Tricks: How To Check Who Visited Your Whatsapp Profile • Database And Internet Data Retriever