FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Which postgres driver to use with jruby

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
Tim Uckun
Posted via mailing list.





PostPosted: Mon Oct 20, 2008 3:26 am    Post subject: Which postgres driver to use with jruby Reply with quote

What is the recommended driver to use with jruby and postgres

Netbeans lists the following.

ruby-postgres
ruby-pg
postgres
postgres-pr
jdbc-postgres
activerecord-jdbc-postgresql-adapter

Too many choices methinks.
Back to top
Erno Mononen
Posted via mailing list.





PostPosted: Mon Oct 20, 2008 9:11 am    Post subject: Which postgres driver to use with jruby Reply with quote

Hi Tim,

I think activerecord-jdbc-postgresql-adapter is your best bet. Please
see
http://www.nabble.com/What's-the-gem-for-JDCB-and-PostgreSQL--td16113630.html
for some discussion on the same topic.

Erno

Tim Uckun wrote:
Quote:
What is the recommended driver to use with jruby and postgres

Netbeans lists the following.

ruby-postgres
ruby-pg
postgres
postgres-pr
jdbc-postgres
activerecord-jdbc-postgresql-adapter

Too many choices methinks.






Back to top
Chris Kutler
Posted via mailing list.





PostPosted: Mon Oct 20, 2008 11:48 pm    Post subject: Which postgres driver to use with jruby Reply with quote

Here is an excerpt from the 6.5 version of the Installing and Configuring Ruby Support tutorial which will be available at release time.


You can access databases from a JRuby on Rails application in one of three ways.
  • MySQL Adapter. The MySQL adapter is included with JRuby. You use this adapter just as you would with a native Ruby on Rails application. If you do not enter any information in Step 3 (Database Configuration) of the New Project wizard, this is the setting that the IDE uses.

  • JDBC Adapter. The JRuby and Rails Distribution plugin includes the ActiveRecord JDBC Adapter gem, which enables your JRuby on Rails application to access database servers that provide JDBC 3.0 compliant drivers, such as MySQL, PostgreSQL, Oracle(R), HSQLDB, and Java DB (also known as Derby). The JDBC driver must be a pure Java driver.
    To use the JDBC adapter in a Ruby on Rails project, select the Access Database Using JDBC checkbox in the Database Configuration step when you create the project, as shown in the next figure.
    If you are using the MySQL or PostgreSQL database server, the IDE automatically adds the bundled driver to the JRuby classpath. For other database servers, the IDE automatically adds the driver to the JRuby classpath if you have registered the database server with the IDE. Otherwise, you must obtain a JDBC 3.0 driver for your database server and add the driver to the JRuby classpath. To add the driver to the classpath, right-click the project's node, choose Properties from the pop-up menu, select the Java category, and click Add JAR/Folder.
    Note: If the GlassFish server is registered, or if the IDE is configured to use Sun Microsystems, Inc. Java Development Kit (JDK) 6.0, the IDE automatically registers the Java DB database server with the IDE.
    If you are running your application on the GlassFish v3 Server, you must also copy the driver to the lib folder of the project's JRuby installation and then restart the server. If you are not sure of the location of the JRuby installation, right-click the project's node and choose Properties from the pop-up menu. Click Manage. The Ruby Platform Manager appears, which shows the path to the JRuby installation.

  • JDBC Adapter for Your Database Server. Several JDBC adapter gems are written for database servers. These gems include the JDBC 3.0 compliant drivers. For example, you can install and use the following gems.
    • H2. activerecord-jdbch2-adapter
    • HSQLDB. activerecord-jdbchsqldb-adapter
    • Java DB/Apache Derby. activerecord-jdbcderby-adapter
    • MySQL. activerecord-jdbcmysql-adapter
    • PostgreSQL. activerecord-jdbcpostgresql-adapter
    • SQLite3. activerecord-jdbcsqlite3-adapter

    To use one of these adapters, edit the adapter settings in the database.yml file under the Configuration node. Use the middle portion of the gem name for the adapter setting. For example, set the adapter to jdbcmysql for the MySQL database.

Tim Uckun wrote:
Quote:
Quote:
What is the recommended driver to use with jruby and postgres

Netbeans lists the following.

ruby-postgres
ruby-pg
postgres
postgres-pr
jdbc-postgres
activerecord-jdbc-postgresql-adapter

Too many choices methinks.


([email]address-removed[/email])
([email]address-removed[/email])

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB