Introduction to DataBase Isolation Levels
Transaction specifies an isolation level that defines the degree to which one transaction must be isolated from resource or data modifications made by other transactions. Isolation Levels are described in terms of side-effects of concurrent access or modification by number of users at a Read more…
Problem: How to insert csv data into mysql table with mysql query in php. What problems usually you face with this and how to resolve them.
Description: I have csv file with thousands of records. I want to insert these records in mysql table with php Read more…
When you do svn update or commit in Eclipse you may face this problem- “working copy xxxxx locked”
Solution: Sometimes the problem can be solved with “project cleanup” or “move the project to some other location without .project and .svn files”. But you may have to solve it Read more…
Heroku throwing ERROR: “The datasource configuration “default” was not found in database.php” with database configuration already present for cakephp app.
In one of our cakephp projects hosted on Heroku we used PostgreSql database. For configuring the database to connect to app code we renamed the database.php.default file Read more…
While fetching data from database, in SQL query I had ‘order by’ clause but the results were not sorted when the data was in alphanumeric form. The reason for this is that SQL sorts character by character from left to right. So it places c10 before c2 as 1< Read more…
Let us take an example:
We have table employees with following fields:
id int primary key,
We have following records in the table:
(1, isha, amr);
(2, Hamlet’s, ghy);
(3, éhjj, amr);
2nd and 3rd records have special characters in their Read more…
We have two tables say table1 and table 2. In table 1, there is a field named Id and this field is set as primary key in table 1. We want to use it as foreign key in table 2.
Fields in both the tables:
Id Read more…
Steps to create a connection to a local postgres database in pgAdmin ||| :
1. Make sure PostgresSql and its components should be installed in ubuntu system.
2. Check what databases are available in postgresSql through terminal
3. Login to PostresSql server in terminal using following command:
sudo -u postgres psql
With Read more…
European characters like è é å ñ ü ,à, è, ì, ò, ù – À, È, Ì, Ò, Ù, ™, © ,• , ∑, α, β, «, » do not get inserted correctly in MySQL by default. To fix it, we need to change the character set (fixed collection of symbols) and collation (set of rules that determine how data is sorted and compared).
To insert and retrieve european characters change character set to utf Read more…
Suppose we want to have columns created_date and last_modified_time with default timestamp in any table in MySQL/Phpmyadmin.
Let us take an example of Students table.
Create table Students using following query :
CREATE TABLE students(
id INT AUTO_INCREMENT PRIMARY KEY ,
first_name varchar(20) NOT NULL,
last_name varchar(20) NOT NULL Read more…
In this post I will give an example of how to perform search with Selenium script on a webpage. Below is the screenshot of the webpage:
Code to automatically enter a keyword “paint” in the textbox and then click Search button (or enter key) is given below. Go through the Read more…
Following is the code to add Combobox in editable data grid:
<table id=”dg” title=” Combobox in editable datagrid ” style=”width:100%;height:700px”
toolbar=”#toolbar” pagination=”true” rownumbers=”true” fitColumns=”false” singleSelect=”true” autoSave=”true” data-options=”pageSize:50″>
< Read more…
Suppose you want to retrieve values from row from 5 to 10 from a table in SQL server. Since LIMIT keyword does not work in it so we can use any of these 2 alternative methods:
Solution 1 :
SELECT * FROM ( SELECT *, ROW_NUMBER() OVER (ORDER BY name) as row FROM TableName Read more…
While running cake bake command for cakephp 3.0 we got the following error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘tablename .columnname’ doesn’t exist
The culprit was a column with name test_id in one of the tables. As per bake command’s conventions about foreign Read more…
In a project we are working on there are large number of pdf files for which field mapping data is stored in the database. In this project pdf forms are auto filled with data from Salesforce. Which PDF form field is mapped to which corresponding Salesforce object or field is Read more…
Index is used for storing values for a specific column in a table. An index is created on a column of a table and used to speed up search queries.
For Example :
Suppose we have a database table called Users with three columns – User_Name, User_Age, and User_Address. Assume that this Read more…
How to connect to Mysql in Selenium script?
Step 1: Import Mysql connector (JDBC driver):
Download connector from:
Download this jar file and import in Eclipse : MySQL-connector-java-5.1.18-bin.jar
Follow these steps in Eclipse:
Add the downloaded Jar to your Read more…
1. Select Database: Schema Transfer Wizard from the Mysql workbench menu bar. You will see schema transfer wizard on your screen as below:
Click on Start the Wizard option.
2. Connection Selection: Now select your source and destination location to copy database:
If you want to Read more…
In MySQL, we generally perform insert, update, select and delete operations on records of table. Multiple Insert operation can also be easily performed on table.
Take an example of Employees table with fields:
Multiple records can be inserted in Employees table in a single query using following MySQL query :
INSERT Read more…
MySql 5.5 is the default version for Ubuntu 14.04
Steps to Upgrade the mysql-server
If you have existing database in Mysql 5.5. It should be migrated automatically.
Take the backup of existing databases:
mysql> mysqldump –lock-all-tables -u root -p -all-databases > backup Read more…