facebook

Adding a new postgres JDBC driver to MyEclipse

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #238257 Reply

    choonhoong
    Participant

    This message has not been recovered.

    #238262 Reply

    Brian Fernandes
    Moderator

    This message has not been recovered.

    #238504 Reply

    choonhoong
    Participant

    Hi Brian,
    I am not going to use that combination as it doesn’t help me run “XDoclet Generation” on my project folders when I right-click on them. I had upgraded to Eclipse 3.1 and MyEclipse 4.0 GA and just could not get XDoclet to work. I believe I could not see the XDoclet plugins in the list of plugins on MyEclipse configuration. It just does not work.
    So I reverted back to this previous combination and XDoclet works just fine. Another developer on this project has the same combination and his XDoclet was working …thats why I moved back to that one. Anyway I am sure I had the DB explorer and Hibernate working properly on this very combination. Whats changed since then? I was not able to List Drivers even then but manually supplying it … fixed it.
    Can you get XDoclet to work on the combo you suggested? try it out

    Cheers,
    Ding

    #238506 Reply

    choonhoong
    Participant

    https://www.genuitec.com/forums/topic/closed-problem-with-running-x-doclet/#post-237681
    (refer to this post for more details on the XDoclet ordeal! )

    #238507 Reply

    choonhoong
    Participant

    Hey Brian,
    OK i tried your suggestion and installed your combo i.e Eclipse 3.1 and MyEclipse 4.0 GA on a seperate machine but the problem with the Driver class still exists!! When i add my JAR files from postgresql into the “ExtraClass Path” tab, the error message appears as “Driver class not found” and the “OK” button is disabled. Why is it not able to recognize the “org.postgresql.jdbc3.Jdbc3ConnectionPool” driver? I can see it when i try navigating to it from the package explorer on the left. So what is the problem? I have noticed that the latest version has no “List Drivers” button anymore….but it still does not recognize the jdbc3 drviers??? Is it because its not called “Driver.class” like the “org.postgresql.Driver”?
    Please help. You help on this will be more than appreciated. Is there some manual workaround?

    Desperate,
    Ding

    #238509 Reply

    Brian Fernandes
    Moderator

    Ding,

    The list driver button has been removed, becuase it searches the jar files you add in the “Driver Libraries” tab (note, it’s Driver Libraries now, not Extra Class Path) for classes which implement the java.sql.Driver interface. If it cannot find one, you will see the “Driver Class not found” message.

    I assume you’re using Windows from your first post – what version?

    There are 3 jar files supplied with my PostgreSQL server installation on windows, each of them work individually (I only need to add one of them), they are named

    pgdev.307.jdbc2.jar
    pgdev.307.jdbc2ee.jar
    pgdev.307.jdbc3.jar

    Each of these jars has a driver class: org.postgresql.Driver

    Now, what is the filename of the jar you are using, and where did you get it? What is the fully qualified name of the Driver class in it which you expect to use?
    I haven’t researched this; I haven’t come across org.postregsql.jdbc3.Jdbc3ConnectionPool yet (I am looking this up now). But my current line of thought is that this is the wrong jar (there is no Driver class in this)

    In the meanwhile, could you try using the jar files I mentioned above?

    Best,
    Brian.

    #238510 Reply

    Brian Fernandes
    Moderator

    Ding,

    You can download the drivers here:
    http://jdbc.postgresql.org/download.html

    Jdbc3ConnectionPool is not a driver implementation, so you will not be able to use that to connect to your database.

    Hope this helps, let us know how it turns out.

    Best,
    Brian.

    #238512 Reply

    choonhoong
    Participant

    Yes. This is Windows XP Home edition I am using here.
    The driver JAR files that come standard with the “Postgresql 8.0” installation for windows are as follows.

    postgresql-8.0-311.jdbc2
    postgresql-8.0-311.jdbc2ee
    postgresql-8.0-311.jdbc3

    org.postgresql.jdbc3.Jdbc3ConnectionPool is the fully qualified name of the driver class that I am expecting in them. The site link that you have given me does not list either of the “pgdev” drivers that you have supplied. Are you sure you have got the correct drivers?
    Let me give you the link I was referring to for the connection pooling on JDBC3. I want to take advantage of the connection pooling feature that postgres provides along with the SessionManager provided by Hibernate. I know I can revert to the normal “org.postgres.Driver”…I get the DB explorer to work with that but I want to use the ConnectionPool class. How do I do that?
    Yeah i think I might be wrong in expecting to use the ConnectionPool as the Driver Class….does that mean I will have to create my own “DataSource” in my implementation? Can you suggest some way I can use this class please?

    The link below was what I was referring to:
    http://www.postgresql.org/docs/7.4/static/jdbc-datasource.html

    Cheers,
    Ding

    #238513 Reply

    Brian Fernandes
    Moderator

    Ding,

    The driver files you listed out from the site shoud do fine, mine were from a beta version of the Windows PostgreSQL install.
    You cannot use org.postgresql.jdbc3.Jdbc3ConnectionPool in our Database Explorer as it is simply not an implementation of java.sql.Driver. So please use any of the drivers you listed out above and the org.postgresql.Driver class to get the DB Explorer up and going.

    You are free to use a DataSource to connect to your database in your application, the link you sent explains this process pretty well.

    Best,
    Brian.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: Adding a new postgres JDBC driver to MyEclipse

You must be logged in to post in the forum log in