I am maintaining one database in django and some another application written in java want to access that database and add some data in it. Here i want common database for Java application and Django application. So whenever need data, we can make query to that database directly. How is it possible???
-
What database backend are you using for Django? What is stopping you from just querying the same database in Java, in the appropriate language? What have you tried?Joost– Joost2015-08-03 11:13:07 +00:00Commented Aug 3, 2015 at 11:13
-
@Joost i m using sqlite3. I dont know java but my temate here want to update data in database....which data i need to tell him...how can i check my database ip and port??Naresh– Naresh2015-08-03 11:20:13 +00:00Commented Aug 3, 2015 at 11:20
-
See argaen's answer, below. That pretty much sums it up.Joost– Joost2015-08-03 11:34:45 +00:00Commented Aug 3, 2015 at 11:34
Add a comment
|
1 Answer
If you are using sqlite3 you don't need to tell any ip or port to your teammate. He just needs the path/name of the sqlite database. You can find the name in your settings.py file in the 'DATABASE' variable.
5 Comments
Joost
Additionally, if the Java code is not running on the same machine, consider switching the Django backend to e.g. MySQL, so that you easily have an actual database server running.
Naresh
@Joost yes java code is not running on same machine......is it necessary to switch to MySQL???
Joost
Well, there are sqlite3 server solutions, but the last painful road is probably to switch database backends in Django. It's well-documented and quite easy.
argaen
Yes, sqlite3 is only for local access. If you need to access the database from a remote machine, consider using Postgres or Mysql. Here you have a simple config example stackoverflow.com/questions/5394331/…
argaen
Plus sqlite3 is not a serious backend database for production. It should only be used for testing.