[ruby-gnome2-doc-cvs] [Hiki] create - tut-libgda-init

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2003年 9月 22日 (月) 05:18:11 JST


-------------------------
REMOTE_ADDR = 217.117.55.140
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/?tut-libgda-init
-------------------------
= Initialising

First of all you have to initialise the Ruby/Libgda library, i.e. to call the Gda.init method:

  Gda.init("TestGDA", "0.1")

The first parameter is the name of your program, and the second is its version.  
Gda.init will also retrieve parameters from the Ruby command line and use them to initialize GDA.

After initialising you can work as usual or make a block of code with the whole stuff, calling Gda.main.  In this case you will need to call Gda.main_quit to exit the program, but remains that Gda.main_quit will be called explicitly after the end of your block.

  Gda.init("TestGDA", "0.1")
  save_ds
  Gda.main do
      list_providers
      list_datasources
      client = Gda::Client.new
      client.open_connection("calvaris", nil, nil, Gda::Connection::OPTIONS_READ_ONLY) do |conn|
          execute_some_queries(conn)
          process_accounts(conn)   
      end
      play_with_parameters
  end





ruby-gnome2-cvs メーリングリストの案内
Back to archive index