Database

Case insensitive like query in sql

Of course like query is case sensitive. If want to make it case insensitive simply make the column lower with lower() function and make the like query.

Here is a example

SELECT * FROM web WHERE lower(metaDesc) LIKE '%dscript%tutorial%'
3 Comments

Find rows within a day interval in mysql

Suppose you have a table where is a datetime or timestamp column that holds create date of row.

Now you want to find the rows that were added within last 7 days. What is the solution ??

Date_SUB is the solution!

Using mysql date_sub function you can solve this issue.

No Comments

Read more

How to connect to oracle database using java

I have oracle 10g installed on my ubuntu. I need a java program to connect with oracle database and fetch data from table.

To do this what I needed first is the oracle-jdbc connector. I found it in “/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib” directory. Two jar files named “ojdbc14.jar” & “ojdbc14_g.jar”.

I openned Netbeans IDE created a new project and from the projects panel i right clicked on the project I connect with oracle and clicked on properties.

When properties window openned I went to Libraries to add those specific jar files.

Then I clicked “Add JAR/Folder” and selected those two files and hit ok.

That added those connector jar files in classpath for my current project. Now all what i needed to do is to write the correct code.

No Comments

Read more

How to connect C# with oracle

This time I am gonna work with my database project. This course was on oracle database. So now I must connect my software interface with oracle. So first try’t with C#. This is how I did it

To connect to oracle database using C# first you what you must do is to install Oracle Database and Microsoft Visual Studio in your computer.
You also should setup oracle cilent in order to have them work with each other.

No Comments

Read more

Connect to Microsoft Access .mdb database using C#

Here is a simple example that will tell you how to connect to microsoft access (mdb) files in C# .NET. To do this you have to make use OLEDB connector

The first you need is to use OLEDB connector.

First we need to use oledb connector namespace.

using System.Data.OleDb;

Now we need to create an instance of OleDbConnection object. The following will be the connection string required to use as parameter of OleDbConnection instance object

2 Comments

Read more

Connect to mysql database using C#

I searched Internet a lot before I could figure out how to connect to mysql database server using C#. This is the one that worked in my favour.

To connect to mysql database using C# first you should have to download a small program called mysql connector .net from MySQL’s official site. Click here to visit this link to download mysql connector .net

6 Comments

Read more

Page 2 of 212