Software Archive
Read-only legacy content
17061 Discussions

How to connect MySQL database in Java ?

Find_N_
Beginner
293 Views

I am coding a module in java that need a database connection with MySQL. I heard about DriverManager but I think it is pretty old method for database connection. Is there any newer and efficient way of doing the same. This Java questions and answers forum comprises of large number of tech and coding expert, So I expect quick and satisfactory solution or full set of instruction/ code require for this.

0 Kudos
3 Replies
Swati_S_Intel1
Employee
293 Views

Are you trying to develop a mobile application? This forum is for Intel XDK -for developing mobile apps - mainly front end. For connecting to back end you typically make AJAX call from the app that gets served by your server script (PHP or other which can connect to MySQL).

0 Kudos
Find_N_
Beginner
293 Views

Thanks for your reply. I only need to connect MySql database in Java not in PHP..

Kindly, can you elaborate ?

Thanks in Advance

0 Kudos
PaulF_IntelCorp
Employee
293 Views

Hello Find -- this forum does not cover the question you are trying to resolve. This forum is directed at the Intel XDK, which is a tool for building Cordova hybrid apps. Cordova hybrid apps cannot use Java, they are built from HTML, CSS and JavaScript. If you want to connect to a database from within a Cordova app you need to build a RESTful API on your server and then use AJAX calls from your application to request and send data to that server. Cordova apps cannot run Java code.

0 Kudos
Reply