Official Site
Friday, December 17, 2010
DB2 connectivity code
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){
}
Wednesday, October 6, 2010
Tuesday, October 5, 2010
Way2Sms Application in C sharp
Thursday, September 23, 2010
Using Web service in C Sharp
Saturday, September 18, 2010
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, September 9, 2010
Thursday, August 19, 2010
Simple Encryptor
import javax.swing.*;Execute the above program.
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);
}
}
Encrypt(E)/Decrypt(D)
File Name:
Sample File
Encrypted File
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
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.
Thursday, August 5, 2010
Saturday, July 24, 2010
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
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;
}
Thursday, April 29, 2010
Algorithm Challenge-FLAMES
Sunday, April 25, 2010
Sunday, April 11, 2010
Java -JDBC
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
Thursday, March 25, 2010
Code Challenge Solved
March 2010 Contest
c
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.
1 | int main() |
2 | { |
3 | return 0; |
4 | } |
01 | extern "C" |
02 | { |
03 | int printf ( const char *format,...); |
04 | } |
05 |
06 | int main() |
07 | { |
08 | printf ( "Hello World" ); |
09 | return 0; |
10 | } |