Seema Shetty

Greenhorn
+ Follow
since Jan 23, 2001
Merit badge: grant badges
For More
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 Seema Shetty

Hi Cindy,
I tried to execute the code which is here.But it gives me application error when it tries to open the file.Why is that so?
Thanks
Seema
22 years ago
Hi,
I need the code to select a file from the specified directory by browsing for that file(html file) and to open it on the internet explorer.
Or I want to know how I can achieve this using some of the api or javascript in jsp?
Thanks in advance
Seeema
22 years ago
Hi,
I have problem in comparing these two Calendar objects .I need to know which among the two given Calendar Objects is Latest One or the Greater one.I'am using the code below.Please let me know how to compare these objects using the code below.Please consider the case for two Strings
boolean comparedate = compareDate("2000/01/01 01:01:00","2001/02/21 12:00:00");
public static boolean compareDate(String date1,String date2)
{
boolean retVal1 = false;
boolean retVal2 = false;
int yyyy1 = 0, yyyy2 = 0;
int mm1 = 0, mm2 = 0, dd1 = 0, dd2 = 0, ss1 = 0, ss2 = 0;
int hh1 = 0, hh2 = 0, min1 = 0, min2 = 0;

retVal1 = isDate(date1);

if (retVal1 == true)
{
dd1 = myCalendar.get(myCalendar.DAY_OF_MONTH);
mm1 = myCalendar.get(myCalendar.MONTH) + 1;
yyyy1 = myCalendar.get(myCalendar.YEAR);
hh1 = myCalendar.get(myCalendar.HOUR);
min1 = myCalendar.get(myCalendar.MINUTE);
ss1 = myCalendar.get(myCalendar.SECOND);
}
retVal2 = isDate(date2);
if (retVal2 == true)
{
dd2 = myCalendar.get(myCalendar.DAY_OF_MONTH);
mm2 = myCalendar.get(myCalendar.MONTH) + 1;
yyyy2 = myCalendar.get(myCalendar.YEAR);
hh2 = myCalendar.get(myCalendar.HOUR);
min2 = myCalendar.get(myCalendar.MINUTE);
ss2 = myCalendar.get(myCalendar.SECOND);
}

// long onehr = 60 * 60 * 1000L;

Calendar earlierdate = new GregorianCalendar();
Calendar laterdate = new GregorianCalendar();
earlierdate.set(yyyy1, mm1, dd1,hh1,min1,ss1);
laterdate.set(yyyy2, mm2, dd2,hh2,min2,ss2);
//How should I compare these Objects earlierdate
//laterdate.Which is bigger?

}//end compareDate
Thanks in advance

22 years ago
Thanks Max,
I tried that and it worked.
Seema.
23 years ago
Hi Max,
Now if I want to set this pointer to the DB_ERROR in a method called setDB_Error().Whwt input parameters should I pass, so that I will have the access to this DB_ERROR array from anywhere within the project.What I mean is
if I have an interface called EnglishError which has the initialization for DB_ERROR[].Then I have a method called as setDB_Error() in a class called ErrorHandler.
What all the input parameters I need to pass to this setDB_Error() , so that I can get access to the DB_ERROR[] of EnglishError interface when I instantiate this with the use bean with the application scope?.Can I have the code for setDB_Error.
I tried to do this way.I do not think,this is right.
public static void setDB_Error()
{

myDBErrArrRef = EnglishError.DB_ERROR;
}
public static String[] myDBErrArrRef = null;
What should be the input parameter, to the above method, so that I can instantiate this method use the code below.
instantiate the ErrorHandler and get access to DB_ERROR[].
<jsp:useBean id="myErrorHandler" scope="application" <br /> class="ErrorHandler">
myErrorHandler.setDB_Error();
</jsp:useBean>
After doing this ,I should also be able to access any of the methods of ErrorHandler.
Thanks
Seema
[This message has been edited by Seema Shetty (edited March 22, 2001).]
23 years ago
Hi,
I need the code sample showing how to set the pointer to the static array.
I have the string array intialized to some strings.
Ex :
static final String[] DB_ERROR = {"dberror1",
"dberror2",
"dberror3",
"dberror4",
"dberror5",
"dberror6",
"dberror7",
"dberror8"};
How can I set the pointer to this?
Thanks in advance
Seema
23 years ago
Hi,
For jdk1.2 and above, it is the path or classpath is not set for classes12.zip.If it is jdk1.1 and below, you should go for classes111.zip.
You should include the classpath upto the file zip file level like below.
C:\Oracle\Ora81\jdbc\lib\classes12.zip.
Good luck.
Mamta

Originally posted by javahelp:
I have compiled program which is using Oracel drive to connect to oarcle database sitting on solaris. When i try to run the program i am getting following error.
Can some one hwlp me.
Thanks
C:\javawork>java Employee
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc8 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1290)
at java.lang.Runtime.loadLibrary0(Runtime.java:473)
at java.lang.System.loadLibrary(System.java:777)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:228)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:249)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java, Compiled Code)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at Employee.main(Employee.java, Compiled Code)
C:\javawork>


Thanks.
Are there any built in java methods to validate the date.
Also, how can we do the same using the methods in java.text.SimpleDateFormat,java.util.Date,java.text.DateFormat,
java.text.ParsePosition,java.text.FieldPosition,
java.text.ParseException.

Originally posted by Alex Kravets:
Hi,
Without writing the code here, but I think you can just take the string, using StringTockenizer(String,"/") brake it up in three strings and check each string individually so:
month.length() = 2,
day.length() = 2,
year.length() = 4?


23 years ago
Hi,
I'am trying to check if the given date is a valid with the following code.
Is this the right way of doing this?
If so,after I get the day, month and year values using the FieldPosition object, is there a built in java method, which tells me that the given String date is a valid date.
One more problem I have with this is, if I enter the date 02/0398/199999, it should give me the exception.But this code parses this date and gives the output for month=3,day=4,year=200000.
But according to the requirement, that should be invalid date.
If this is not the right way, how can I proceed to achieve my results .Please get me the clue about what all the methods i need to use and what is the sequence.May be Calendar method or something else.
public class hello extends HttpServlet {
String sDate="02/0398/199999"; Date date;
int MONTH; int DAY; int YEAR;


protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
// DatePattern datepattern;
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();

SimpleDateFormat dateformat = new SimpleDateFormat("MM/dd/yyyy");
try{
date = dateformat.parse(sDate);
out.println("date is parsed" + date);

}
catch (ParseException ee) {
out.println(ee.getMessage());
}
FieldPosition posMonth = new FieldPosition(DateFormat.MONTH_FIELD);
FieldPosition posDay = new FieldPosition( DateFormat.DATE_FIELD);
FieldPosition posYear = new FieldPosition(DateFormat.YEAR_FIELD);

StringBuffer yearBuf = new StringBuffer();
StringBuffer monthBuf = new StringBuffer();
StringBuffer dayBuf = new StringBuffer();
try{
yearBuf = dateformat.format(date,yearBuf,posYear);
monthBuf = dateformat.format(date, monthBuf, posMonth);
dayBuf = dateformat.format(date, dayBuf, posDay);

}
catch (Exception ex1) {
out.println(ex1.getMessage());
}
int mBegin = posMonth.getBeginIndex();
int mEnd = posMonth.getEndIndex();
int dBegin = posDay.getBeginIndex();
int dEnd = posDay.getEndIndex();
int yBegin = posYear.getBeginIndex();
int yEnd = posYear.getEndIndex();
try{

MONTH = Integer.parseInt(monthBuf.substring(mBegin, mEnd));
DAY = Integer.parseInt(dayBuf.substring(dBegin, dEnd));
YEAR = Integer.parseInt(yearBuf.substring(yBegin, yEnd));

}
catch(Exception ne)
{
out.println(ne.getMessage());
}

int mEntered = 0;
int dEntered = 0;
int yEntered = 0;
// traps a number format exception if syntax is bad
try{
mEntered = Integer.parseInt(sDate.substring(mBegin, mEnd));
dEntered = Integer.parseInt(sDate.substring(dBegin, dEnd));
yEntered = Integer.parseInt(sDate.substring(yBegin, yEnd));


}
catch (Exception nee)
{
out.println(nee.getMessage());
}
if ( YEAR == yEntered && DAY == dEntered && MONTH == mEntered )
{

}
}
}
23 years ago