On Thu, Apr 9, 2009 at 9:05 AM, Karen Tracey <kmtra...@gmail.com> wrote:
> On Thu, Apr 9, 2009 at 4:13 AM, NK B <nkbalaj...@gmail.com> wrote: > >> >> hello friends >> i'm work with django. but i create the reports in java >> how to link java and postgresql.please help me... >> >> i'm try following code but driver found not connect with db what do >> to.... >> > > You're really on the wrong list for this question. Your problem is getting > a connection from your Java code to your database, Django has absolutely > nothing to do with this. However... > > >> [snip] >> //c = DriverManager.getConnection("jdbc:postgresql://localhost/ >> database","username", "password"); >> >> c = DriverManager.getConnection("jdbc:postgresql://localhost:8000/ >> database","balaji","test"); >> > > The :8000 there is almost certainly wrong, assuming you are running the > Django development server on port 8000. The connection you are looking to > create in your Java code here goes directly to your database server, not > through Django in any way. I've no experience connecting to a postgres > database from Java, but for MySQL at least there is no need to specify a > port unless you have configured the database to run on some non-standard > one. My suspicion as to what is wrong with your commented-out line is that > your database is not really named 'database', and that if you put your real > database name in its place the original line might work. > Also real username and password also, of course. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---