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???
            Asked
            
        
        
            Active
            
        
            Viewed 2,586 times
        
    1
            
            
        - 
                    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 Aug 03 '15 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 Aug 03 '15 at 11:20
- 
                    See argaen's answer, below. That pretty much sums it up. – Joost Aug 03 '15 at 11:34
1 Answers
3
            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.
 
    
    
        argaen
        
- 4,145
- 24
- 28
- 
                    1Additionally, 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. – Joost Aug 03 '15 at 11:36
- 
                    @Joost yes java code is not running on same machine......is it necessary to switch to MySQL??? – Naresh Aug 03 '15 at 12:03
- 
                    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. – Joost Aug 03 '15 at 12:05
- 
                    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 http://stackoverflow.com/questions/5394331/how-to-setup-postgresql-database-in-django – argaen Aug 03 '15 at 12:06
- 
                    Plus sqlite3 is not a serious backend database for production. It should only be used for testing. – argaen Aug 03 '15 at 12:07
