UDP Server and Client Thursday, Jan 7 2010 

Program for UDP Server and Client

Server Program:

import java.io.*;
import java.net.*;

public class Server
{

public static void main(String str1[]) throws Exception
{
DatagramSocket ds;
byte[] buf=new byte[1024];
ds=new DatagramSocket(200);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println(“Enter the String”);
InetAddress ia=InetAddress.getLocalHost();
(more…)

FTP Server and Client Thursday, Jan 7 2010 

FTP Program

Server Program:

import java.io.*;
import java.net.*;

public class Server
{
public static void main(String asd[]) throws Exception
{
ServerSocket ss=new ServerSocket(1024);
System.out.println(“ServerSocket Generated”);
Socket s=ss.accept();
System.out.println(“ServerSocket Accepted”);
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
PrintStream p=new PrintStream(s.getOutputStream());
String fname,str;
(more…)

JDBC – Creating Table in Oracle Tuesday, Dec 22 2009 

Database Connectivity

import javax.swing.JOptionPane;
import java.sql.*;
public class JDBCCreateTable{

static String userid=”scott”, password = “tiger”;
static String url = “jdbc:odbc:bob”;    // String url = “jdbc:mySubprotocol:myDataSource”; ?
static Statement stmt;
static Connection con;
public static void main(String args[]){

JOptionPane.showMessageDialog(null,”JDBC Programming showing Creation of Table’s”);
int choice = -1;

do{
choice = getChoice();
if (choice != 0){
getSelected(choice);
}
}
(more…)

Remote Command Server & Client Friday, Dec 12 2008 

Remote Command Execution

rceServer

import java.io.*;

import java.net.*;

public class rceserver

{

public static void main(String a[])throws IOException

{

ServerSocket s = new ServerSocket(8001);

System.out.println(“Started: “+ s);

try

{

Socket scr = s.accept();

(more…)

Datagram Server & Client Friday, Dec 12 2008 

Socket Programming – UDP

DatagramClient

import java.io.*;

import java.net.*;

class datagramclient

{

public static DatagramSocket ds;

public static byte buffer[]= new byte[1024];

public static int clientport = 789, serverport = 790;

public static void main(String args[]) throws Exception

{

ds=new DatagramSocket(serverport);

(more…)

Next Page »