Help coderanch get a
new server
by contributing to the fundraiser

Parham Emami

Greenhorn
+ Follow
since Jul 11, 2003
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 Parham Emami

Hi,
I've used bobs with the following piece of code. You could adapt it to what you require:

public void setBlob(PreparedStatement pstmt, int index, Object obj) throws DAOException, SQLException {
ByteArrayOutputStream b_out = new ByteArrayOutputStream();
try {
ObjectOutputStream o_out = new ObjectOutputStream(b_out);
o_out.writeObject(obj);
o_out.close();
} catch (IOException e) {
log.error(e);
throw new DAOException(e);
}
byte[] b = b_out.toByteArray();
ByteArrayInputStream b_in = new ByteArrayInputStream(b);


pstmt.setBinaryStream(index, b_in, b.length);
}

this method could be used by your insert or update method like this:
setBlob(pstmt1, 2, myObject);

Cheers
Parham
Hi,
I've used bobs with the following piece of code. You could adapt it to what you require:

public void setBlob(PreparedStatement pstmt, int index, Object obj) throws DAOException, SQLException {
ByteArrayOutputStream b_out = new ByteArrayOutputStream();
try {
ObjectOutputStream o_out = new ObjectOutputStream(b_out);
o_out.writeObject(obj);
o_out.close();
} catch (IOException e) {
log.error(e);
throw new DAOException(e);
}
byte[] b = b_out.toByteArray();
ByteArrayInputStream b_in = new ByteArrayInputStream(b);


pstmt.setBinaryStream(index, b_in, b.length);
}

this method could be used by your insert or update method like this:
setBlob(pstmt1, 2, myObject);

Cheers
Parham
16 years ago
Hello there,

Have you tried this one?
request.getSession(true).getServletContext().getServerInfo();

I hope it might help.

Cheers
Parham
16 years ago
hello there,

you could also create an OS related script (.sh or .exe) containing the -java command to run your CLASS file. be aware that from OS perspective, this script should be eligible to recognize your JDK and your class file.

Cheers
Parham
16 years ago
And I suggest to call it enhanced for loop, as far as we don't and won't have anything to do with .Net

Cheers
16 years ago
You could use some utility programs to convert any type of charset to any out put you want. Also you could simply use MS Front page as I did for Arabic which I completely don't understand in one of the projects.
Follow these steps:
1- Change the language of your OS to the language you want to work with (by Ctrl+Shift or ...), in your case Czech.
2- Put the text(in Czech language) in the code within <body>. The charset could be UTF-8 or Wndows-1252.
3- Overview it.
4- Get back to code tab, you've got what you want.
5- Put it as the value for that text key in the messages properties file.

That worked for me. Also you could use some sophisticated lang utilities such as SC Unipad.

Cheers, Good Luck
16 years ago
One of the decompiler softwares:
http://members.fortunecity.com/neshkov/dj.html

It's better NOT to answer an inquiry if the answer's a bit bitter.

Cheers Bro
16 years ago
Inner classes lives on the heap as they're object type while methods live on the stack which are two different contexts and places on the memory. The value of non-final method variables might change during the lines, while the final method variables will have the same fixed value which is reliable to use for inner class in another place in memory(heap).

Cheers
16 years ago
First,Change your member variable modifiers to private.
Second, this could be the result of incompatible versions of app server and your JDK (I've experienced once before).

Cheers
16 years ago
JSP
The reasons are:
1- You better have more specific exception types in order to handle different scenarios more efficiently. Imagine you wish your class to take different actions for each type of exceptions.

2- It is easy-to-read for your other coleagues; It'll be easier to maintain for the next poor guy debugging your code. {Sun estimates that over the lifetime of a standard piece of code, 20 percent of the effort will go into the original creation and testing of the code, and 80 percent of the effort will go into the subsequent maintenance and enhancement of the code.}

3- It has just the same nature as the case to have a general class doing various sort of stuff by having hundreds of methods (just like structured programming languages) instead of having classes doing that class-specific jobs which are high cohesion ones. That's the reason you might define your own user-specific exception classes.

Conclusion: writing a code working just fine is NOT the whole idea, writing a code presenting your good style applying good OO patterns is the best practice.

Cheers
Parham
16 years ago
Just wondering, is there any new book for SCWCD 310-083 version? All I could find was just related to 310-081 exam.

Does anybody know whether there's a new version for the "Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam (SCWCD)" written by Kathy Sierra?

Any help or piece of information is highly appreciated.
there are three ways to get the values of html elements:

1)(first and the easiest)the best way to take out the value of the elements of your html form is to use {request.getParameter("htmlElementName")}
and pass it through an {String},
2)and so if you have many {txtInputs} and it's so hard to handle them one by one you should name them in logical proper names {like:txtInputName,txtInputFamily,...} and then you can use the {request.getAttributeNames()} to take out the parameters(by casting) and pass them through an Enumeration object to navigate them.
3)and you can also use {request.getAttribute()} method and use its value by casting it to string
but the 1 and 2 are the best way to handle the parameters of an html elements.
i'll be glad if i could help you a little: Parham.
[ February 05, 2004: Message edited by: Parham Emami ]
20 years ago
JSP
OS: Windows XP - Pro
IDE: Jbuilder 7
JDBC driver: Microsoft JDBC Driver
DBMS: MS SQLServer 2000
my Authentication mode inside SqlServer is both windows and SQLServer. But when I want to connect to db from my java program with the followingurl:
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=parham1","myWindows UID","myWindowsPWD";
I get the following Exception:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC] [SQLServer]Login failed for user 'myWindowsUID'.
Thank you for your help and support
hi my friends:
how can i star studing this certification?
thanks arham Emami