Dinesh Jayaraj

Greenhorn
+ Follow
since Nov 19, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dinesh Jayaraj

dear friends:
I am a student doing my project unfortunately
I am not able to complete my project so I wanted to show
a project which is my imaginative.
In the code below first it count the number
of urls in the DB then it will create that many number of threads
(FtpTest which extends Thread class)to download new files from each site(url) now my doubt is
1>what are the maximum number of threads we can create like this?suppose my database contains some thousands of urls is it
possible to create that many number of threads?
2>suppose iam creating an instance of java.util.Hashtable class in FtpTest class which extends Thread, then for each thread created in FtpMain,wheather new instance of hashtable is created or only single instance of hashtable is shared by all threads?

3>i want upadateCompareFile to be executed by only one thread, which update date in a file on the local hard disc how it can be done?.
I am in tension please anybody help me as much as possible i will be greatfull for them
and i will remember them.
thanx in advance.
dinesh

[This message has been edited by Dinesh Jayaraj (edited March 08, 2001).]
Dinesh,
Could you please use [ code] [ /code ] tags to format your code. Lookup the UBB Code hyperlink for further details.
Thanks.

[This message has been edited by Rahul Mahindrakar (edited March 09, 2001).]
dear friends:
I have to start a project named "site monitoring"
in which i have to check for content change in the page of the url and i have to give email alerts to specified members if the content in the page changes. its should be done automatically.
for content change cheking i can compare the lastmdified date of file size from the responce code returned
by the server also for automation i can use shedulig support
windows operating systems.
Now my problem is how to give email alers to the
members automaticaly???i dont know which are the packages help for that and also iam quite unfamiliar with email applications,
so if anybody have done such applications please help me by
sending code which helps for the same or any website which
helps for further information u may contact dineshjayaraj@yahoo.com.
thanx a lot in advance
dinesh

------------------
21 years ago
Java is case sensitive,
props.put("http.proxyHost","192.168.1.1");
props.put("http.proxyPort","80");
(Notice the capital H and P)
Hope this helps
[This message has been edited by Carl Trusiak (edited January 09, 2001).]
I accidently deleted Dinesh's original post, sorry.
He ask why he was unable to connect throuh a proxy using the code
Properties props=System.getProperties();
props.put("http.proxyhost","192.168.0.1");
props.put("http.proxyport","80");
System.setProperties(props);

[This message has been edited by Carl Trusiak (edited January 09, 2001).]
dear friends:
i have written a gui to access a database and to excute a query entered by the user.(just for reference code is listed below) which works nicely.
Now iam trying to connect to a SQLServer database which is in the WindowsNT server to which my machine is connected. in the
local machine i have set the userDSN(using msODBC32 driver in the control panel)to the database in the server.
when run the pgm here is the exception iam getting.
java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'INFORMINDIA\DINESH'.
the driver i have loaded: sun.jdbc.odbc.JdbcOdbcDriver
the url to getConnection: jdbc dbc:mahesh1
where mahesh1 is the userDSN specifying the database at WindowsNT server.
Iam not able to find out what is the problem?
is there any problem with url or driver?
The same pgm if i used to access the MSAccess db on the same server it works nicely for which driver is same
and url:-jdbc dbc:mahesh where mahesh dsn refers to MSaccess db on the server.
thanks in advance
dinesh
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class AccessApp extends Frame {
TextField driver = new TextField(60);
TextField url = new TextField(60);
TextField sql = new TextField(60);
Button doIt = new Button("Do it!");
TextArea resultArea = new TextArea(10,60);
public static void main(String args[]){
AccessApp app = new AccessApp();
}
public AccessApp() {
super("AccessApp");
setup();
pack();
addWindowListener(new WindowEventHandler());
show();
}
void setup() {
setupMenuBar();
setLayout(new GridLayout(2,1));
Panel topPanel = new Panel();
topPanel.setLayout(new GridLayout(4,1));
Panel panels[]=new Panel[4];
for(int i=0;i<panels.length;++i){>
panels[i]=new Panel();
panels[i].setLayout(new FlowLayout(FlowLayout.LEFT));
}
panels[0].add(new Label("Driver:"));
panels[0].add(driver);
panels[1].add(new Label("URL: "));
panels[1].add(url);
panels[2].add(new Label("SQL: "));
panels[2].add(sql);
doIt.addActionListener(new ButtonHandler());
panels[3].add(doIt);
for(int i=0;i<panels.length;++i)>
topPanel.add(panels[i]);
add(topPanel);
add(resultArea);
}
void setupMenuBar() {
MenuBar menuBar = new MenuBar();
Menu fileMenu = new Menu("File");
MenuItem fileExit = new MenuItem("Exit");
fileExit.addActionListener(new MenuItemHandler());
fileMenu.add(fileExit);
menuBar.add(fileMenu);
setMenuBar(menuBar);
}
void accessDB() {
try{
// Load JDBC driver
Class.forName(driver.getText());
// Connect to database
Connection connection=DriverManager.getConnection(url.getText());
Statement statement = connection.createStatement();
// Execute SQL
boolean hasResults = statement.execute(sql.getText());
if(hasResults){
// Get results of query
ResultSet result = statement.getResultSet();
if(result!=null) displayResults(result);
}else resultArea.setText("");
// Close database connection
connection.close();
}catch(Exception ex){
resultArea.setText(ex.toString());
}
}
void displayResults(ResultSet r) throws SQLException {
ResultSetMetaData rmeta = r.getMetaData();
// Use meta data to obtain the number of columns
int numColumns=rmeta.getColumnCount();
String text="";
for(int i=1;i<=numColumns;++i) {
if(i<numColumns)>
text+=rmeta.getColumnName(i)+" | ";
else
text+=rmeta.getColumnName(i);
}
text+="\n";
while(r.next()){
for(int i=1;i<=numColumns;++i) {
if(i<numColumns)>
text+=r.getString(i)+" | ";
else
text+=r.getString(i).trim();
}
text+="\n";
}
resultArea.setText(text);
}
class ButtonHandler implements ActionListener {
public void actionPerformed(ActionEvent ev){
String s=ev.getActionCommand();
if(s=="Do it!") accessDB();
}
}
class MenuItemHandler implements ActionListener {
public void actionPerformed(ActionEvent ev){
String s=ev.getActionCommand();
if(s=="Exit"){
System.exit(0);
}
}
}
class WindowEventHandler extends WindowAdapter {
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
}

[This message has been edited by Dinesh Jayaraj (edited December 14, 2000).]
[This message has been edited by Dinesh Jayaraj (edited December 14, 2000).]
how to support for sheduling in java
dear sir : iam doing project in which i have to support sheduling for ex u might have seen windows operating system supports sheduling,like u may see the clock in the taskbar of windows it will be running continuously, it will show the correct time when u boot the computer every time. In the similar fashion i have written an application for url validation i want to set the frequency of that application say 2 days(what ever) it should run automatically without user intervention once for the specified time frequency, u can assume that computer will be running continuously.
Is there any packages or third party tools which can be used to support such type of sheduling.
if anybody have written such type application please send the code for my reference. please help me iam in hurry.
humbly request
thanks a lot in advance
dinesh
21 years ago
how to support for sheduling in java
dear sir : iam doing project in which i have to support sheduling for ex u might have seen windows operating system supports sheduling,like u may see the clock in the taskbar of windows it will be running continuously, it will show the correct time when u boot the computer every time. In the similar fashion i have written an application for url validation i want to set the frequency of that application say 2 days(what ever) it should run automatically without user intervention once for the specified time frequency, u can assume that computer will be running continuously.
Is there any packages or third party tools which can be used to support such type of sheduling.
if anybody have written such type application please send the code for my reference. please help me iam in hurry.
humbly request
thanks a lot in advance
dinesh
21 years ago
how to support for sheduling in java
dear sir : iam doing project in which i have to support sheduling for ex u might have seen windows operating system supports sheduling,like u may see the clock in the taskbar of windows it will be running continuously, it will show the correct time when u boot the computer every time. In the similar fashion i have written an application for url validation i want to set the frequency of that application say 2 days(what ever) it should run automatically without user intervention once for the specified time frequency, u can assume that computer will be running continuously.
Is there any packages or third party tools which can be used to support such type of sheduling.
if anybody have written such type application please send the code for my reference. please help me iam in hurry.
humbly request
thanks a lot in advance
dinesh
21 years ago
how to support for sheduling in java
dear sir : iam doing project in which i have to support sheduling for ex u might have seen windows operating system supports sheduling,like u may see the clock in the taskbar of windows it will be running continuously, it will show the correct time when u boot the computer every time. In the similar fashion i have written an application for url validation i want to set the frequency of that application say 2 days(what ever) it should run automatically without user intervention once for the specified time frequency, u can assume that computer will be running continuously.
Is there any packages or third party tools which can be used to support such type of sheduling.
if anybody have written such type application please send the code for my reference. please help me iam in hurry.
humbly request
thanks a lot in advance
dinesh
21 years ago
hello friends
1> iam totaly confused with dsn?
what does it do?what is file dsn? system dsn? and user dsn?
why we should set them before connecting to db.
2>the method Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
will load the driver(jdbc:odbc)actually from where it is
loaded wheather from jdk or windows os.
3>in jdbc url like jdbc:odbc:xyz
wheather xyz is a dsn or a database name?
if it is dsn how it will resolve the
actual table name when we query the database.in the url we have to give userid
and password wheather theese userid and password corresponds to db or dsn?.
help please
dinesh

[This message has been edited by Thomas Paul (edited December 11, 2000).]

Originally posted by deekasha gunwant:
hi dinesh,
your program is compiling and running fine on my m/c with Win NT and jdk1.3.
I feel u should try reinstalling the jdk.
regards
Deekasha


hi deekasha:
i have reinstalled windows95 as well as jdk1.3 but still
same pbm.
dinesh

21 years ago
hello everybody:
here is a simple program i have written to create a frme. this pgm compiles successfully without any errors
but when i run the pgm(using command:java filename)it gives the error dialog given below
java
this program has performed an illegal operation and will be
shutdown.
if the problem persists, contact the program vendor.
but when the same program run on the other system
where same jdk1.3 has been installed it runs nicely without
giving any dialog like this.
due to this problem iam not able to create any frame or
applet,and swing programs on my systems please
anybody find out the problem and tell the solution.
thanks in advance
dinesh

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FrameDemo {
public static void main(String s[]) {
JFrame frame = new JFrame("FrameDemo");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}

------------------
21 years ago
hello everybody:
here is a simple program i have written to create a frme. this pgm compiles successfully without any errors
but when i run the pgm(using command:java filename)it gives the error dialog given below
java
this program has performed an illegal operation and will be
shutdown.
if the problem persists, contact the program vendor.
but when the same program run on the other system
where same jdk1.3 has been installed it runs nicely without
giving any dialog like this.
due to this problem iam not able to create any frame or
applet,and swing programs on my systems please
anybody find out the problem and tell the solution.
thanks in advance
dinesh

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FrameDemo {
public static void main(String s[]) {
JFrame frame = new JFrame("FrameDemo");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}
21 years ago
hello everybody:
here is a simple program i have written to create a frme. this pgm compiles successfully without any errors
but when i run the pgm(using command:java filename)it gives the error dialog given below
java
this program has performed an illegal operation and will be
shutdown.
if the problem persists, contact the program vendor.
but when the same program run on the other system
where same jdk1.3 has been installed it runs nicely without
giving any dialog like this.
due to this problem iam not able to create any frame or
applet,and swing programs on my systems please
anybody find out the problem and tell the solution.
thanks in advance
dinesh

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FrameDemo {
public static void main(String s[]) {
JFrame frame = new JFrame("FrameDemo");
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
JLabel emptyLabel = new JLabel("");
emptyLabel.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}
21 years ago
hello iam beginer in java pgming
before excuting the program we have to
set the path but i dont know how they work
can anybody tell in detail how does thees
following statements work.
path=%path%;set bin=c:\javajdk\bin
set lib=c:\javajdk\lib
set include=c:\javajdk\include
set CLASSPATH=c:\dinesh1
plese tell me in deatail
thanks in advance
dinesh jayaraj
21 years ago
hello iam beginer in java pgming
before excuting the program we have to
set the path but i dont know how they work
can anybody tell in detail how does thees
following statements work.
path=%path%;set bin=c:\javajdk\bin
set lib=c:\javajdk\lib
set include=c:\javajdk\include
set CLASSPATH=c:\dinesh1
plese tell me in deatail
thanks in advance
dinesh jayaraj
------------------
21 years ago