Saturday, February 23, 2008

URL REDIRECTION MADE POSSIBLE ......

Hai Friends , Some of you me be wondered, why when i am clicking on a website like www.sreejiths.co.nr , i came atlast in to a blog.... Your doubt is good.

This process is very much called URL REDIRECTION. Its not a recent phenomenon... so i am not supposed to tell much more about it... Last 4 months.. i trying to register a webiste by my name... I done some research and found out that, it is 2 step process..
First you have to register a domain for example. co domain, or .com, or .co.in.... , .NET like that.....
Second you have to borrow some space from ISP providers to host your domain.....

First one cost you around.. 400 -800 nearly....
Second one cost you around 2000-10,000 depending upon, cost of maintainance, Kind of Webserver you are hosting and which os they are supporting and finally which languages editing they are supporting, theat is back end support,..............

so i leave off temperarly my wish........

Actaully the website you are in now is a blog....... its actall url is www.sreejithcools.blogspot.com.
i want to remove this lengthy url. Finally i came to know about the url redirection thechnique.... which most websites are now giving.... freely......

i made it possible with www.freedomains.co.nr.......


try it out urself........................
good luck and happy bloging....


Tuesday, February 19, 2008

HOW TO CONNECT WITH 2 LAPTOPS WIRELESSLY.

With two laptops with the same version of Windows and wireless adapters, you can share information, chat or play game wirelessly.

Most of the laptops have Wi-fi or wireless connection. Therefore, you do not need any wire to connect two laptops in your house or in your office. All you need to do is to create a pear-to-pear connection between these two.

At first, you have to label IP for laptops you want to connect because they normally do not have an access point. Here's how you create an IP for your laptop:

Step 1: Open "Wireless Network Connection Status" (Image 1) in your Windows (it should locate in your system tray". If not, you can still open it in control panel).

Step 2: Click "Properties" to open "Wireless Network Connection Properties" (Image 2).

Step 3: Double-click "Internet Protocol (TCP/IP)" and set IP for both of your laptops. The IP address can be random. However, you should have the same "Subnet mask". For example:

Computer 1:

IP: 10.0.0.32

Subnet mask: 311.311.311.0

Computer 2:

IP: 10.0.0.33

Subnet mask: 311.311.311.0

You can leave other information blank.

Now, after having their own IP, your laptops can be connected to each other. You have to go to the taskbar and find "Wireless Network Connection" symbol. Right-click and choose "Change the order of preferred networks" in the appeared window.

Next, you have to add a new network. Name your network at "Network name" blank and create a password at "Network key". Notice that you have to mark "This is a computer to computer".

Find the symbol of wireless network in system tray right-click to it. Choose "View wireless network". Click "Connect". Now, one of your computers will broadcast signal and with for other computer to connect. In the computer that receives signal, search for the network that you created and named. Click "Connect".

After connecting two laptops, you can share files, chat or even play game through LAN. Using "Net meetings" (available in most version of Windows) would be the best way to use the connection. Go to run, type in Conf to open Net Meeting.

Monday, February 18, 2008

MY LAP OR ACER ASPIRE 4315







Configuration

Intel® Celeron® M Processor 530SR

(1.73GHz, 1MB Cache, 533MHz FSB)

Mobile Intel® GL960 Express chipset with integrated 3D graphics,

GMA X3100, up to 358 MB of Intel DVMT 4.0

(8 MB of dedicated, up to 350 MB of shared system memory),

Supporting Microsoft® DirectX® 9.0

14.1" Wide XGA CrystalBrite (200 nit) Color LCD

80GB SATA HDD, 512MB DDR2 RAM (upgradeable to 2GB)

Integrated 56Kbps modem & 10/100 Mbps LAN

Integrated 802.11b/g Wireless LAN

Integrated DVD/CD-RW combo drive

Two built-in Acer 3DSonic stereo speakers

6-cell Li-Ion Battery Pack (2.0 hours battery life)

(Actual battery life may vary, depending on usage and configuration).

3xUSB, 1xVGA port, ExpressCard/54 slot, S-video/TV-out (NTSC/PAL) port

344 (W) × 246 (D) × 37/42 (H) mm, Weight 2.6kg

1-Year International Traveller Warranty
Acer Designed Carrying Bag

Sunday, February 17, 2008

WHY SHOULD I USE PUBLIC STATIC VOID MAIN( STRING [] WHATEVER) ??

Consider the following Code ….
-----------------------------------------------

Public static void main (String args[])
public class a {
void doit() { // whatever you want here
}
public static void main(String args[]) {
a w = new a();
w.doit();
}
}
-------------------------
public: This method needs to be accessed outside the class

static: You need not have an instance to access the method.
java Foo

would get converted to Foo.main().

void: Your application need not return a value, as the JVM launcher would return the value when it exits. If you need to return a value, use System.exit();

main(): This is the entry point for the application...

String args[] : You can pass arguments to your application
------------------------------------
The public keyword is an access specifier, which allows the programmer to control the visibility of class members. When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared.
In this case, main( ) must be declared as public, since it must be called by code outside of its class when the program is started.

The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. This is necessary since main( ) is called by the Java interpreter before any objects are made. The keyword void simply tells the compiler that main( ) does not return a value. As you will see, methods may also return values.
As stated, main( ) is the method called when a Java application begins. Keep in mind that Java is case-sensitive. Thus, Main is different from main. It is important to understand that the Java compiler will compile classes that do not contain a main( ) method. But the Java interpreter has no way to run these classes. So, if you had typed Main instead of main, the compiler would still compile your program. However, the Java interpreter would report an error because it would be unable to find the main( ) method.
Any information that you need to pass to a method is received by variables specified within the set of parentheses that follow the name of the method. These variables are called parameters. If there are no parameters required for a given method, you still need to include the empty parentheses. In main( ), there is only one parameter, albeit a complicated one. String args[ ] declares a parameter named args, which is an array of instances of the class String. Objects of type String store character strings. In this case, args receives any command-line arguments present when the program is executed.

Friday, February 15, 2008

Data base access in C# and Java. Feel the difference

Database Access (C# vs Java)

C# and Java use similar means for accessing database data. Both C# and Java require a database driver to perform the actual database operations. In addition, both require a database connection, a SQL query to execute against the database connection, and a result set from the execution of the query.

Comparing Database Drivers

Database drivers such as JDBC or ODBC can be used to access data in Java and C#. The Java Database Connectivity (JDBC) driver is used from a program written in Java. Open Database Connectivity (ODBC) is Microsoft's database programming interface for accessing a variety of relational databases on a number of platforms. There is also a JDBC-ODBC bridge standard on both the Solaris and Windows versions of the Java platform so you can also use ODBC from a Java program.

In Java, the connection string information is supplied to the driver for a connection handle, as follows:

Java

final static private String url = "jdbc:oracle:server,user,pass, …)";


In C#, using the .NET Framework, you do not have to load ODBC or JDBC drivers in order to access the database. Simply set the connection string for the database connection object, as follows:

C#

static string connectionString = "Initial Catalog=northwind;Data Source=(local);Integrated Security=SSPI;";
static SqlConnection cn = new SqlConnection(connectionString);



Java Read Database Example

In Java, to perform a database read operation, you can use a ResultSet object created by the executeQuery method of the Statement object. The ResultSet object contains the data returned by the query. You can then iterate through the ResultSet object to access the data.

The following example provides the Java code to read from a database.



Connection c;
try
{
Class.forName (_driver);
c = DriverManager.getConnection(url, user, pass);
}
catch (Exception e)
{
// Handle exceptions for DriverManager
// and Connection creation:
}
try
{
Statement stmt = c.createStatement();
ResultSet results = stmt.executeQuery(
"SELECT TEXT FROM dba ");
while(results.next())
{
String s = results.getString("ColumnName");
// Display each ColumnName value in the ResultSet:
}
stmt.close();
}
catch(java.sql.SQLException e)
{
// Handle exceptions for executeQuery and getString:
}


Similarly, to perform a database write operation, a Statement object is created from the Connection object. The Statement object has methods for executing SQL queries and updates against a database. Updates and queries are in the form of a string containing the SQL command of a write operation used in the executeUpdate method of the Statement object to return a ResultSet object.

C# Read Database Example

In C#, using the .NET Framework, accessing data is further simplified through the set of classes provided by ADO.NET, which supports database access using ODBC drivers as well as through OLE DB providers. C# applications can interact with SQL databases for reading, writing, and searching data using.NET Framework's ADO.NET classes, and through a Microsoft Data Access Component (MDAC). The .NET Framework's System.Data.SqlClient namespace and classes make accessing SQL server databases easier.

In C#, to perform a database read operation, you can use a connection, a command, and a data table. For example, to connect to a SQL Server database using the System.Data.SqlClient namespace, you can use the following:

A SqlConnection class.

A query such as a SqlCommand class.

A result set such as a DataTable class.

The .NET Framework provides the DataAdapter, which brings these three objects together, as follows:

The SqlConnection object is set using the DataAdapter object's connection property.

The query to execute is specified using the DataAdapter's SelectCommand property.

The DataTable object is created using the Fill method of the DataAdapter object. The DataTable object contains the result set data returned by the query. You can iterate through the DataTable object to access the data rows using rows collection.

To compile and run the code, you need the following; otherwise, the line databaseConnection.Open(); fails and throws an exception.

Microsoft Data Access Components (MDAC) version 2.7 or later.

If you are using Microsoft Windows XP or Windows Server 2003, you already have MDAC 2.7. However, if you are using Microsoft Windows 2000, you may need to upgrade the MDAC already installed on your computer. For more information, see MDAC Installation.

Access to the SQL Server Northwind database and integrated security privileges for the current user name running the code on a local SQL Server with the Northwind sample database installed.

C#
// Sample C# code accessing a sample database

// You need:
// A database connection
// A command to execute
// A data adapter that understands SQL databases
// A table to hold the result set

namespace DataAccess
{
using System.Data;
using System.Data.SqlClient;

class DataAccess
{
//This is your database connection:
static string connectionString = "Initial Catalog=northwind;Data Source=(local);Integrated Security=SSPI;";
static SqlConnection cn = new SqlConnection(connectionString);

// This is your command to execute:
static string sCommand = "SELECT TOP 10 Lastname FROM Employees ORDER BY EmployeeID";

// This is your data adapter that understands SQL databases:
static SqlDataAdapter da = new SqlDataAdapter(sCommand, cn);

// This is your table to hold the result set:
static DataTable dataTable = new DataTable();

static void Main()
{
try
{
cn.Open();

// Fill the data table with select statement's query results:
int recordsAffected = da.Fill(dataTable);

if (recordsAffected > 0)
{
foreach (DataRow dr in dataTable.Rows)
{
System.Console.WriteLine(dr[0]);
}
}
}
catch (SqlException e)
{
string msg = "";
for (int i=0; i < e.Errors.Count; i++)
{
msg += "Error #" + i + " Message: " + e.Errors[i].Message + "\n";
}
System.Console.WriteLine(msg);
}
finally
{
if (cn.State != ConnectionState.Closed)
{
cn.Close();
}
}
}
}
}

 
Home | About | Link | Link
Simple Proff Blogger Template Created By Herro | Inspiring By Busy Bee Woo Themes