Official Site

click here to view our new site launched

Pages

Friday, December 17, 2010

DB2 connectivity code

try{
Class.forName("com.ibm.db2.jcc.DB2Driver");
System.out.println("JDBC IBM Driver is loaded");
}
catch(Exception e)
{
System.out.println("Exception 1 :"+e);
out.println("Exception 1 :"+e);
}
Connection conn=null;
Statement stmt;
try{


conn=DriverManager.getConnection("jdbc:db2://localhost:50000/TEMP" ," db2admin" ,"db2admin");
System.out.println("Connected to DB2");
//out.println("Connected to DB2");
}
catch(Exception e)
{
System.out.println("exception 2 : "+e);
//out.println("exception 2 : "+e);

}
try{
PreparedStatement stm = null;
stmt=conn.createStatement();
ResultSet r=stmt.executeQuery("select * from SYSTEM.TEM");
//out.print("DFDF:");
while(r.next())
{out.print(""+r.getString(1));
}
conn.close();
}
catch(Exception e){
}

Tuesday, October 5, 2010

Way2Sms Application in C sharp


Web service for way2sms used in C sharp Windows Form Application.
It Sends the same SMS to multiple phone numbers. Give your 10 digit phone number for user ID. Separate each phone number with a semicolon(';').

Click below for demo..

Thursday, September 23, 2010

Using Web service in C Sharp

Step 1: Creating a proxy
Goto visual studio command prompt. Type wsdl url
for example:
C:\Program Files\Microsoft Visual Studio 10.0\VC>cd c:\
c:\>wsdl http://www50.brinkster.com/vbfacileinpt/np.asmx?wsdl


Step2: Create an windows Application
copy the .cs file (here for example PrimeNumbers.cs) file from c:\ and paste into windows application folder. In visual studio right click on PrimeNumbers.cs and include in project
Step3: Goto project Add reference->.NET tab->system.web.services

Step4: create a namespace.
Ex: open PrimeNumbers.cs file and namspace Myprime{ enclosed by body of code ... }

Step5: create an object.
Ex: Myprime.PrimeNumbers p=new Myprime.PrimeNumbers();

Step6: now call the method in your application using object
Ex : p.GetPrimeNumbers(); it will return string containing prime numbers.

Step7: Run the windows application.

You can able to find lot of webservices at


Click here to download project files
Click here to see demo


Friday, September 10, 2010

AJAX


AJAX is not a new programming language, but a new way to use existing standards.AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page.

With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. The use of Ajax techniques has led to an increase in interactive or dynamic interfaces on web pages. Data is usually retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not actually required, nor do the requests need to be asynchronous.

Drawbacks

  • Owing to their dynamic nature, Ajax interfaces are often harder to develop when compared to static pages.
  • Pages dynamically created using successive Ajax requests do not automatically register themselves with the browser's history engine, so clicking the browser's "back" button may not return the user to an earlier state of the Ajax-enabled page, but may instead return them to the last full page visited before it. Workarounds include the use of invisible IFrames to trigger changes in the browser's history and changing the URL fragment identifier (the portion of a URL after the '#') when Ajax is run and monitoring it for changes.
  • Dynamic web page updates also make it difficult for a user to bookmark a particular state of the application. Solutions to this problem exist, many of which use the URL fragment identifier (the portion of a URL after the '#') to keep track of, and allow users to return to, the application in a given state
  • Depending on the nature of the Ajax application, dynamic page updates may interfere disruptively with user interactions, especially if working on an unstable internet connection. For instance, editing a search field may trigger a query to the server for search completions, but the user may not know that a search completion popup is forthcoming, and if the internet connection is slow, the popup list may show up at an inconvenient time, when the user has already proceeded to do something else.
  • Because most web crawlers do not execute JavaScript code,publicly indexable web applications should provide an alternative means of accessing the content that would normally be retrieved with Ajax, to allow search engines to index it.
  • Any user whose browser does not support JavaScript or XMLHttpRequest, or simply has this functionality disabled, will not be able to properly use pages which depend on Ajax. Similarly, devices such as mobile phones, PDAs, and screen readers may not have support for the required technologies. Screen readers that are able to use Ajax may still not be able to properly read the dynamically generated content.The only way to let the user carry out functionality is to fall back to non-JavaScript methods. This can be achieved by making sure links and forms can be resolved properly and do not rely solely on Ajax. In JavaScript, form submission could then be halted with "return false".
  • Like other web technologies, Ajax has its own set of vulnerabilities that developers must address. Developers familiar with other web technologies may have to learn new testing and coding methods to write secure Ajax applications.
  • Ajax-powered interfaces may dramatically increase the number of user-generated requests to web servers and their back-ends (databases, or other). This can lead to longer response times and/or additional hardware needs.

Thursday, August 19, 2010

Simple Encryptor

" An encryptor converts meaningful information into gibbrish form so that it is safe from the eyes of unauthorized people "
import javax.swing.*;
import java.io.*;
public class encrypt
{
public static void main(String arg[]) throws FileNotFoundException, IOException
{
String choice = JOptionPane.showInputDialog("Encrypt(E)/Decrypt(D)");
String file= JOptionPane.showInputDialog("File Name:");
File usrfile = new File(file);
File encfile = new File("enc.txt");
encfile.createNewFile();
BufferedWriter userStream = new BufferedWriter( new FileWriter(encfile));
try
{
PushbackReader in = new PushbackReader( new BufferedReader ( new FileReader(usrfile)));
int c=-4,i=0,temp=0;
while(c!=-1)
{
c=in.read();
temp=c;
if(c==-1)break;
if(choice.equals("e")||choice.equals("E"))
{
if(temp%2==0)temp+=9;
else temp-=7;
}
else if(choice.equals("d")||choice.equals("D"))
{
if(temp%2!=0)temp-=9;
else temp+=7;
}
userStream.write(String.valueOf((char)temp));
}
in.close();
userStream.close();
usrfile.delete();
File usrfile2 = new File(file);
encfile.renameTo(usrfile2);
}
catch(IOException e)
{
JOptionPane.showMessageDialog(null,e);
}
System.exit(0);
}
}
Execute the above program.
Encrypt(E)/Decrypt(D)
enc2
File Name:
enc3
Sample File
en1
Encrypted File
enc4
To get back the non-gibberish form or decrypted text, execute the code once again and enter d in the first window and file name in the following window.
Note:
  • This code can be used to encrypt/decrypt only files encoded in Text Format
  • The file to be encrypted has to be in the same folder from which the code is executed.
  • Sound knowledge of Java is required to understand and successfully execute the above code.

Friday, August 6, 2010

Shutdown Computer with Your Cell Phone

Shutdown Computer with Your Cell Phone

Using this method, a user can shutdown, restart, hibernate, etc. his or her computer, just by sending an email from his or her phone.

To do this, all you will need is Microsoft Outlook which should come withMicrosoft Office, which most people have. This will need to be on thecomputer wish you wish to shutdown.

So, this is how you do this:


1. First, you need the batch files to perform the Shutdown, Hibernate etc. You can write them down yourselves

2. open your note pad

and write lik this...

c:\windows\system32\shutdown -s -f -t 00

and save it as shutdown.bat

3. Open up Microsoft Outlook. Make sure that you have already configured it for your email.Now we will need to make it so that Outlook checks your inbox about every minute (1 minute for testing time can be increased if a delayed shutdown is desired). You can do this by going to Tools: Options.

4. Then click the Mail Setup tab, and afterwards, the Send/Receive button.

5. Make sure that the Schedule an automatic send/receive every... box is checked, and set the number of minutes to 1. Now you may close all of these dialog boxes.

6. Now go to Tools: Rules and Alerts... Next click the options button in the upper right hand corner and press the Import Rules button.

7. Now select the shutdown.bat file ...whi u hv created ...

8. Now, when you send a message from your phone to your e-mail address with the subject shutdown or smsshutdown%%, your computer will shutdown.
JSP-Servlets for creating Excel Sheet dynamically

Saturday, July 24, 2010

Useful Articles : Top 12 Websites To Download Free E-Books

An E-Book so called as a digitally transformed book where simple text converted into e-text that built the digital media similar of our common printed book. An E-Book, as defined by the Oxford Dictionary of English, is "an electronic version of a printed book which can be read on a personal computer or hand-held device designed specifically for this purpose".

We all know the importance of books in life to design our interest level and develop sharp knowledge. Hard copy of book are inconvenient in carrying all the time, anywhere for book lovers. So E-Books have revolutionized the print media, hence reducing deforestation and at the same time it has provided better option for securing the information for longer period of time.

After putting long hours and effort we succeed in covering up "Top 12 Websites To Download Free E-Books" for your use so that you are able to save your time rather than hanging around on plenty of website on internet.

1. Scribd

2. PlanetPDF

3. UFindBook

4. Bookyards

5. Free-Ebooks

6. FictionWise

7. FreeBookCentre

8. MemoWare

9. OnlineComputerBooks

10. E-BooksDirectory

11. FreeBookSpot

12. Ebookslab

Useful links for u...


Useful links for u...


http://www.sync4brain.com/

http://downloadtotallyfreeebooks.blogspot.com/

http://www.ebook3000.com/
http://www.free-ebook-download.net/
http://www.knowbest.info/
http://www.nytimes.com/
http://www.aboutonlinetips.com/
http://www.twenty19.com/



Saturday, June 12, 2010

MS -Access database Connectivity

//JAVA SNIPPET FOR MS-ACCESS DB CONNECTIVITY


public class DataBaseConnection {

Statement stmt;

Connection con;

ResultSet rs;

String url;

public Connection connect()throws ClassNotFoundException,SQLException

{

// Step 1. Load the Type 1 database driver:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

// Step 2. Create a connection to the database

// using pre-defined Data Source:

File f=new java.io.File("c:/Train.accdb");

if(f.exists())

url= "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" +f.getPath();

else

url= "jdbc:odbc:Train";

con = DriverManager.getConnection(url,"","");

return con!=null ? con:null;


}

public void close() throws SQLException{
con.close();
}
}


Click below to download code JAVA BEAN

Thursday, April 29, 2010

Algorithm Challenge-FLAMES


We all have played a game called FLAMES during our childhood. In this we take input as two names, eliminate the similar alphabets in both the words and count the remaining number of alphabets and calculate the corresponding relationship according to
FLAMES(Friend, Love, Affection, Marriage, Enemy or Sister)

Input:
Input description... Name of you and your partner

Output:
Output description... Count the number of remaining dissimilar alphabets and according to flame find the corresponding relationship F- Friend L- Love A-Affection M- Marriage E - Enemy S- Sister


Sunday, April 11, 2010

April Code Challenge Solved

April 2010 Code Solved

April Code Challenge

Java -JDBC


JDBC coding available here...

JDBC CODING


Setting up ODBC

Administrative Tools->Data Sources (ODBC).

Next you have to add a data source that the JDBC-ODBC Bridge driver can open.

To do so, click add.

Make sure you select "Microsoft Access Driver" as shown above and click finish.

In the next screen enter a name for your data source - this is the name you will use in your Java code to open your database. Also enter a description. Use the "Select" button to browse for your database on your PC.

Below is what you should now have:

Click Ok. Your database will now be in the list of data sources


jdbc - java database connectivity

Thursday, March 25, 2010

Code Challenge Solved

March 2010 Contest




March Coding Contest Solved


c










Beautiful coding:


What to know how to code without using semicolon?

void main(int a ,int b)
{
if(clrscr(),printf("\nEnter two integers:"),scanf("%d %d",&a,&b))
while(printf("\nSuccessful addition:%d",a+b),getch(),0)
{ }
}


Program without header file?


So continuing in the series of program without, here are two more programs. The first one is just a valid C program without any header file.
1int main()
2{
3 return 0;
4}
The above program will actually compile and run.
But you will say it did nothing. So lets have a program without header file which prints something.

01extern "C"
02{
03 int printf(const char *format,...);
04}
05
06int main()
07{
08 printf("Hello World");
09 return 0;
10}
$2.49 .COM at GoDaddy.com! Expires 5/14/13