Friday, September 21, 2012


Solution to provide tomcat 6.0.26 server webapps environment to deploy Servlets/JSP files compiled by client XP machines.
Server information
Server Information
Tomcat Version
JVM Version
JVM Vendor
OS Name
OS Version
Apache Tomcat/6.0.26
1.6.0_20-b20
Sun Microsystems Inc.
Linux
2.6.35.6-45.fc14.i686

My Server is Core Fedora 14.


1
Install Samba Server Configuration Tool 1.2.90 on Server.

2
Disable firewall and suse linux in Administration tool on Server.

3
Add a Samba Share -> choose a folder i.e., webapps of/var/lib/tomcat6/webapps and tick in writable and visible.

4
Provide Access permission to a particular created user or give access to everybody  after creating  user/users whatever necessary 

5
Now access Samba share from client through \\192.168.1.10(or )IP of your server, enter user credentials.

6
     Copy the compiled servlets/jsp files to samba share webapps directory from client XP.

7
Now access http://192.168.1.10:8080/ (remote tomcat) from client and enter to tomcat manager by giving credentials.

8
Now you will see your application here you can deploy/undeploy/start/stop your Application.



 Hope you will enjoy..
Janardhan..

JDBC connection from XP client to remote Oracle 10g server using thin driverjdbc version 10.2.0.1.0


Step 1 Create a table and insert some data in Oracle 10g
Step 1 Copy classes12.jar to java/lib
Step 2 Create classpath :) set classpath=C:\Program Files\Java\jdk1.6.0_12\lib\classes12.jar;
Step 3 Create below code and change ip as your oracle server ip address 
Step 4 Compile the code
Step 5 Execute the code

import java.sql.*;
class sampleDB{
public static void main(String args[]) throws Exception
boolean repeat=true;
while(repeat)
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.162:1521:orcl","scott","tiger");
System.out.println("Connected Successfully To Oracle");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from emp321");
while(rs.next())
{
int no=rs.getInt(1);
String name=rs.getString(2);
float sal=rs.getFloat(3);
System.out.println("EMPLOYEE NO:"+no);
System.out.println("EMPLOYEE NAME:"+name);
System.out.println("EMPLOYEE SAL:"+sal);
System.out.println("---------------");
repeat=false; }
catch(Exception e)
System.out.println("exception is raised,try again"); }
}
}

Hope you enjoy :)
Janardhan..