473,503 Members | 10,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to connect to a database by ruby, and modify, add or delete?

3 New Member
can ruby access, existing MySQL databases to modify
(add information, search or running queries)

if yes please let me know
Sep 6 '07 #1
4 6781
rustyc
5 New Member
Yes, you should be able to do that, but it will be MUCH easier to do if your database follows the rules for table names.

I'd suggest a look at some of the standard tutorials, or even (gasp) go get the 'official' ruby on rails book - go to http://www.rubyonrails.org/ and find the 'agile web development with rails' book. Shoot, you can even download it (for a price).

Since you ask only about ruby, and not rails, the 'other' main book on Ruby alone might be all you need. Again, google is your friend here - look for "Programming Ruby: the Pragmatic Programmer's Guide".

Note that, in my experience, the Rails book is enough to get you going, but not necessarily in the best direction. I'm still fighting with my web application, and I finally find out that I'm woefully messed up in handling the transition from 'thing on the web page that came from the database' to 'saving the changed thing back to the database' when the web page is of my creation and not of the scaffold....
Sep 6 '07 #2
improvcornartist
303 Recognized Expert Contributor
You may need to create a new data source. Then you should be able to connect with
Expand|Select|Wrap|Line Numbers
  1. DBI.connect("dbi:ODBC:MyDSNName", "username", "password")
  2.  
Sep 7 '07 #3
rustyc
5 New Member
Boy, improvcornartist, you got me - I forgot all about the db setup config file in rails. I should have mentioned 'config/database.yml' as where you'd need to go set up your database, IF you are using Ruby on Rails....
Sep 7 '07 #4
Mohamed Muneer Selim
3 New Member
pardon, but it seems I'm having problems in installing ruby

first I installed ruby
then I installed gems then rails but the problem is that I want an interface for ruby instead of using bash, it might be confusing sometimes
also I want to know how to run ruby (I've been using irb)
and now I'm trying to install NetBeans

that if you offered help, I would be thankful
thanks in advance
Sep 8 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3121
by: Sarah Tanembaum | last post by:
I was wondering if it is possible to create a secure database system using RDBMS(MySQL, Oracle, SQL*Server, PostgreSQL etc) and web scripting/programming language(Perl, PHP, Ruby, Java, ASP, etc)...
220
18803
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
54
6502
by: Brandon J. Van Every | last post by:
I'm realizing I didn't frame my question well. What's ***TOTALLY COMPELLING*** about Ruby over Python? What makes you jump up in your chair and scream "Wow! Ruby has *that*? That is SO...
3
1499
by: Mark | last post by:
Hi - I want to provide a secure (ASP) based file browser - based on a parent/child table of files/images etc - stored in a directory on a server. I want to be able to have individuals, who...
4
6433
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
7
3620
by: | last post by:
I am having trouble figuring out to call a database INSERT procedure from a simple submit form. It appears I should use the onclick event to trigger the procedure called BUT when I do this I...
11
2864
by: =?Utf-8?B?c2NodXJzdDMw?= | last post by:
Hi, I am currently trying to get back into ASP and have begun looking at an old webpage I developed some years ago, it was fully functional back in 2002 and I had it up and running with no...
2
3548
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
6
5153
by: idealfellow | last post by:
Hi Guys, I have tried out several ways to connect to my MYSQL database thru Ruby on my windows machine. I have used ruby-mysql, mysql-ruby, ruby DBI....but havent been lucky so far,...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.