Showing posts with label java program. Show all posts
Showing posts with label java program. Show all posts

Tuesday, July 16, 2013

Learn C# programming language : Lesson 001 Introduction

Introduction to the C# language and .Net Framework

C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .net framework. You can use C# to crate traditional windows client applications, XML web services , distributed components, client-server applications, database applications, and integrated debugger, and many other tools to make it easier to develop applications based on version 4.0 of the C#  language and version 4.0 of the .NET framework.

C# language

C# syntax is highly expressive , yet it is also simple and easy to learn. The curly- brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or java. Developers who know any of these languages are typical bale to begin t work productively in C# within a very short time C# syntax simplifies many of the complexities of C++ and provides powerful features such an null-able value types, enumerations, delegates lamda expressions and direct memory access, which are not found in java. C# supports generic methods and types which provide increased type safety and performance and iterators, which enables implementer of collection classes to define custom iteration behavior that are simple to use by client code. Language Integrated Query (LINQ) expressions make the strongly typed query a first class language construct.

An Object Oriented language C# supports the concepts of encapsulation, inheritance and polymorphic, All variables and methods, including the Main method , the application's entry point , are encapsulated within class definitions, A class may inherit directly from one parent class, but it may implement any number of interface methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition . 

There are no header files, and no requirement that methods and types be declared in a particular order. A C# file may define any number of classes, structs , interfaces , and events.

C#.net having code Best Security Because
  1. it is case sensitive
  2. Every statement ends with terminator i.e. semicolon(;)
  3. Every Block quoted by curly Braces ({})
  4. It is purely Maintain type Conversion.

Tuesday, December 18, 2012

Creating Data Source Object in Windows for type 1 JDBC Driver


A database is a structured collection of data. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports processes requiring this information (for example, finding a hotel with vacancies).

Datasource is a name given to the connection set up to a database from a server. The name is commonly used when creating a query to the database.
JDBC is a Java-based data access technology (Java Standard Edition platform) from Sun Microsystems. It is an acronym as it is unofficially referred to as Java Database Connectivity.

The JDBC type 1 driver, also known as the JDBC-ODBC bridge, is a database driver implementation that employs theODBC driver to connect to the database. The driver converts JDBC method calls into ODBC function calls.The driver is platform-dependent as it makes use of ODBC which in turn depends on native libraries of the underlying operating system the JVM is running upon.
Functions :
Translates a query by JDBC into a corresponding ODBC query, which is then handled by the ODBC driver.
Advantages :
Almost any database for which ODBC driver is installed, can be accessed.
Disadvantages :
  • Performance overhead since the calls have to go through the jdbc Overhead bridge to the ODBC driver,then to the native db connectivity interface (thus may be slower than othe types of driver).
  • The ODBC driver needs to be intalled on the client machine.
  • Not suitable fo rapplets, because the ODBC driver needs to be intalled on the client.

Steps to Create Object Data Source :


Step 1 :
Search for ODBC Data Source Administrator in the Start menu.
Select ODBC Data Source Administrator.

Step 2 :
Window : ODBC Data Source Administrator
Under the "User DSN" tab click "Add" Button.
Step 3 :
Window : Create New Data Source
Select " Microsoft Access Driver(*.mdb,*.accdb)"
Click "Finish"
If you can find the option it is due to the Driver Problems , maybe because your system has 64 bit operating system.
To build and run an application as a 32-bit application on a 64-bit operating system, you must create the ODBC data source with the ODBC Administrator in %windir%\SysWOW64\odbcad32.exe.


Step 4 :
Window : ODBC Microsoft Access Setup
Name the Data Source. (Here CMDSN)
DSN name is Case sensitive so be careful.
It should be the same as the DSN name in you Java Program. 
Then click "Select"






Step 4 :
Window: Select Database
Browse the Directories for you MS Access Database.
Then Select the required Database in the left panel and the click "OK"
The "List Files of type:" should be "Access Databases"







Step 4:
Window: ODBC Microsoft Access Setup
Click "OK"
The Selected file Path and Name is shown beside the "Database" Label
Click "OK" 
DONE

NEXT:
You can now Manipulate you tables through you Java Program.





[edit]