Обсуждение: connection problem in postgresql
Dear Sir/Madam, I am a programmer in sharjah,uae. Now i am working in postgresql. I cannot able to connect to postgresql.I am pasting my code here. Class.forName("org.postgresql.Driver"); Connection conn=3DDriverManager.getConnection("jdbc:postgresql://127.0.0.1= /* postgres*", "*postgres*", "sadeen"); here sadeen is my password. But i don't know what to give where i underlined. I am working as postgres# prompt in database. I have created database with -- create database mydatabase; how to use that database as use mydatabase in mysql. Looking forward to hear from you, Yours truly, George
"Majo George Cheruvathur" <majogeorges@gmail.com> writes: > I cannot able to connect to postgresql.I am pasting my code here. > Class.forName("org.postgresql.Driver"); > Connection conn=3DDriverManager.getConnection("jdbc:postgresql://127.0.0.1= > /* > postgres*", "*postgres*", "sadeen"); > here sadeen is my password. > But i don't know what to give where i underlined. This is not a bug. For help with using the JDBC driver I'd suggest the pgsql-jdbc list; you're more likely to find people who know about jdbc there. The people who read pgsql-bugs are mostly core-database hackers. regards, tom lane
String url =3D "jdbc:postgresql://localhost/test"; Properties props =3D new Properties(); props.setProperty("user","fred"); props.setProperty("password","secret"); props.setProperty("ssl","true"); Connection conn =3D DriverManager.getConnection(url, props); although there are different forms for the url connection string. Do no forget to have the *.jar in your classpath. You'd even like to look at this, http://pugs.postgresql.org/uae/ As rightly pointed out by Tom, please choose appropriate mailing list for the respective problem, cool. Luckys.