View RSS Feed

All Blog Entries

  1. Create SQL File in Eclipse

    by , 05-21-2011 at 10:03 PM (My Java Tips)
    SQL files can be created manually in any existing eclipse project. It's simple and useful. I'll list the required steps.

    • Open Database Development perspective
    • Select File > New > Other, expand SQL Development, select SQL File, and click Next
    • This will open the New SQL File wizard.
    • To create a new project, click "Create Project" and follow the wizard instructions. Now provide the SQL file name.
    • Select a connection profile type from the Connection profile
    ...
    Tags: eclipse, sql Add / Edit Tags
    Categories
    Eclipse
  2. Using reflection QueryRequestTag

    by , 05-21-2011 at 09:51 PM (My Java Tips)
    This post presents an example that show use of reflection in creating a tag. The created tag will call some methods of the request (HttpServletRequest) object using reflection.

    Source code for the QueryRequestTag handler is presented below:

    Java Code:
    public class QueryRequestTag extends ExTagSupport {
        static Object []params = new Object[0];
        
        static Hashtable methods = new Hashtable();
        
        static LocalStrings ls =
    ...
  3. Tags and JavaBeans

    by , 05-21-2011 at 09:42 PM (My Java Tips)
    We use tags and beans to fetch data from the bean and present it. If you have some knowledge about these, then you will love working with these.

    Bean interaction involves JSP getting the value of some property of a bean and displaying that value to the user. Another role of JavaBean is defining how events are specified. Tags can be concerned with two bean-related issues:

    • Introspecting the beans to find the properties and get the methods that these tags should call
    ...
    Tags: javabean, tag Add / Edit Tags
    Categories
    Java EE
  4. Reflection example - accessing private data

    by , 05-21-2011 at 05:28 PM (My Java Tips)
    If you think that you cannot access private data members of a class from some other class, then think again. With Reflection, this is possible.

    Using reflection, we can see / view / access a private member, private variable, private method. Some people will not like this with argument that this actually means messing up the laws of encapsulation. I use it for unit testing private methods.

    Example follows:


    Java Code:
    import java.lang.reflect.Field;
    ...
    Tags: reflection Add / Edit Tags
    Categories
    Java SE
Page 18 of 18 FirstFirst ... 8161718