Re: getConnection() method of PreparedStatement
От | Sulakshana Awsarikar |
---|---|
Тема | Re: getConnection() method of PreparedStatement |
Дата | |
Msg-id | 004101c1aaee$02cb97c0$0500a8c0@vsnl.net.in обсуждение исходный текст |
Ответ на | Re: getConnection() method of PreparedStatement (Ned Wolpert <wolpert@yahoo.com>) |
Список | pgsql-jdbc |
Thanks everybody ! I have now switched to the 7.1.3 driver and atleast part of my problem is solved. Thanks again regards Sulakshana ----- Original Message ----- From: "Ned Wolpert" <wolpert@yahoo.com> To: "Sulakshana Awsarikar" <sulakshana@mithi.com>; "Stefano Reksten" <sreksten@sdb.it> Cc: <pgsql-jdbc@postgresql.org> Sent: Thursday, January 31, 2002 7:34 PM Subject: Re: [JDBC] getConnection() method of PreparedStatement > Sulakshana- > > BTW, the problem with JDBC is that you still have to change your code > between databases, since the SQL needs to change. (Example, getting > sequences) If you really dont want to ever change your SQL or jdbc code > between postgresql, db2, ms-sql, etc, get an object-mapping tool like > castor or toplink. I'm working on the castor project to make sure the > tool supports postgresql. (I'm also going to try to get rowsets > implemented in the jdbc driver by 7.3, hopefully. :-) > > There are other drivers available, I'm sure. Check out sourceforge.net. > > Good luck. > > --- Sulakshana Awsarikar <sulakshana@mithi.com> wrote: > > Before testing my application with PostgreSQL, I have tested it with > > MySQL and MS SQL Server 7.0 and their respective JDBC drivers. The > > application works without throwing any kind of exceptions. > > > > The very basis of using drivers that are supposed to implement the JDBC > > API > > specs is that the application can use any backend database without > > having to modify code. > > > > Clearly this is missing here if the ResultSet interface of Postgresql > > driver > > does not give me a getRow() implementation or the PreparedStatement > > interface does not give me a getConnection() implementation. > > > > Is there any postgresql driver which does provide these implemetations ? > > Modifying the application because of lack of implementation of abstract > > methods is not an option that can be considered. > > > > regards > > Sulakshana > > > > > > ----- Original Message ----- > > From: "Stefano Reksten" <sreksten@sdb.it> > > To: "Sulakshana Awsarikar" <sulakshana@mithi.com> > > Sent: Thursday, January 31, 2002 4:40 PM > > Subject: Re: [JDBC] getConnection() method of PreparedStatement > > > > > > > At 16.12 31/01/02 +0530, you wrote: > > > >On using the getConnection() method from the PreparedStatement > > interface > > the > > > >java.lang.AbstractMethodError exception is thrown. > > > >Similarly for methods like getRow() from the ResultSet interface. > > > > > > Sulakshana, > > > you should not ask a connection from the PreparedStatement, but you > > should > > do > > > Class.forName("org.postgresql.Driver"); > > > DriverManager.getConnection("jdbc:postgresql:<database name>", > > > "<user>", >"<password>"); > > > PreparedStatement pstmt = c.prepareStatement("<query>"); > > > ... > > > ResultSet rs = pstmt.executeQuery(); > > > > > > You will get a proper class that *implements* the interfaces. > > Interfaces > > > are just a "contract" between classes. HTH > > > > > > Ciao, > > > Stefano > > > > > > > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 6: Have you searched our list archives? > > > > http://archives.postgresql.org > > > ===== > Virtually, Ned Wolpert <wolpert@yahoo.com> > > "Who watches the watchmen?" -Juvenal, 120 AD (4e75) > > __________________________________________________ > Do You Yahoo!? > Great stuff seeking new owners in Yahoo! Auctions! > http://auctions.yahoo.com > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >
В списке pgsql-jdbc по дате отправления:
Следующее
От: Stefano RekstenДата:
Сообщение: Quirks in driver and docs (Was: Re: No suitable driver found exception)