ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby concepts part 2 (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby concepts part 2
#4630
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
There are some prerequisites before we can o write Ruby scripts to access MySQL databases, we will need to have the Ruby MySQL module installed
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4631
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
Database Connection

Assuming we are going to work with MySQL database.

Before connecting to a database make sure followings:

1. We have created a database TESTDB.

2. We have created EMPLOYEE in TESTDB.

3.This table is having fields FIRST_NAME, LAST_NAME, AGE, SEX and INCOME.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4632
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
4.User ID "testuser" and password "test123" are set to access TESTDB

5. Ruby Module DBI is installed properly on the user's r machine.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4633
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
If a connection is established with the datasource then a Database Handle is returned and saved into dbh for further use otherwise dbh is set to nill value and
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4634
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
If a connection is established with the datasource then a Database Handle is returned and saved into dbh for further use otherwise dbh is set to nill value .

Finally before coming out it ensures that database connection is closed and resources are released
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4635
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby concepts part 2 3 Years, 11 Months ago Karma: 0  
INSERT Operation

INSERT operation is required when we want to create our records into a database table
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved