What is difference between Hashtable and Hashmap?
Hashtable is synchronized means it's therad safe, where as hashmap is not and hash table can't store null value hashmap can store null values. A hashmap is not synchronized and faster than hashtable
In one of the field of my html form, I have to send large text(huge text) to mysql database using jdbc. So how do I store this large text using Clob/Blob in mysql.
This code portion might help you, do changes as your requirment:
File file = new File(browse10a);//browse10a is file path
//hope this code will help you... all the best *-- Yogesh Tiwari
Can the JDBC-ODBC Bridge be used with applets?
Use of the JDBC-ODBC bridge from an untrusted applet running in a browser, such as Netscape Navigator, isn't allowed. The JDBC-ODBC bridge doesn't allow untrusted code to call it for security reasons. This is good because it means that an untrusted applet that is downloaded by the browser can't circumvent Java security by calling ODBC. Remember that ODBC is native code, so once ODBC is called the Java programming language can't guarantee that a security violation won't occur. On the other hand, Pure Java JDBC drivers work well with applets. They are fully downloadable and do not require any client-side configuration. Finally, we would like to note that it is possible to use the JDBC-ODBC bridge with applets that will be run in appletviewer since appletviewer assumes that applets are trusted. In general, it is dangerous to turn applet security off, but it may be appropriate in certain controlled situations, such as for applets that will only be used in a secure intranet environment. Remember to exercise caution if you choose this option, and use an all-Java JDBC driver whenever possible to avoid security problems.
What is the difference between String and StringBuffer?
In String class we can't change but stringBuffer class does. String is final object which means cannot be changed, while StringBuffer is not final object, can be changed after initalization.
Well String is a final class so is StringBuffer class declaration is as below:
public final class StringBufferextends Object implements Serializable, CharSequence
A class being final does not imply that it is immutable or reference
can not be changed. String has been implemented in such a way that every
time you assign or append a String variable a new object would be created
and replacing the reference to the old object. Which means that the old
String object(to which reference has been lost) exists till the JVM stops
or it gets garbage collected. The reason why you declare a class final
is not that you want to make the objects immutable, rather when a class
is made final you are sure that the class cannot be extended(sub-classed)
to change the default implementation or purpose of the String type.
Arraylist is not synchronized while vector is. Arraylist has no default size while vector has a default size of 10. *. Arraylist don't define any increment size while vector does. Arraylist can be seen directly without any iterator while vector requires an iterator to display all it's content. (not very sure).
Vector is synchronized which means tread safe, while ArrayList is not.. Here I would also like to add that though ArrayList is not thread safe that does not imply that Vectors are better than ArrayList. One should prefer ArrayList over Vector, thats the general rule. Since Vector is synchronized it leads to performance degradation. If there are any thread safety issues you could synchronize that particular block of code. One should remember that Arrays are faster than ArrayList, if performance is a concern, then it is prefereable over ArrayList and Vector. *-- CK
More Java Questions
Have a Java Problems
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.