Razik
Razik

Reputation: 182

How to connect a desktop java application and an online mysql database and execute query?

I am trying to create an desktop application for shop. I can create create desktop app and database individually but I dont know how to connect them and how to execute query from desktop. May be for executing query I should use php but I dont know how. My database have been created in hosting site using cpanel.

Upvotes: 1

Views: 1801

Answers (3)

Mark Powell
Mark Powell

Reputation: 13

Your Question is Vague But here is a tutorial on creating a Java Connection to a database.

http://www.homeandlearn.co.uk/java/connect_to_a_database_using_java_code.html

Upvotes: 0

Tejas
Tejas

Reputation: 2475

You need some kind of APIs on the server side. First learn about RESTful APIs and build your server accordingly. Decide a PHP framework to do this with ease.

Next design your desktop application in JAVA which has

  1. Ability to connect to your APIs ( Give Credentials use OAuth2 or something.)

  2. Store data locally and Sync it whenever Internet Connectivity is available ( Resolve conflicts when syncing )

This will need lots of research and efforts. Happy Coding!

Upvotes: 2

Deval Khandelwal
Deval Khandelwal

Reputation: 3548

This is a broad question. If you are using php to build a desktop application (which appears to be), you must download WAMP server for executing php scripts locally. But I recommend you making a desktop application using java swing or any other popular GUI-based programming language. Please go through MySQL using Java's JDBC tutorial . Also Google as the question has a quite broad scope.

Upvotes: 0

Related Questions