Tuesday, 11 February 2014

resultSet.next() always returns “false”!!

You might be executing some query in your application and even though that you verified all the connection parameters like connection URL to the database, username and password, and the SQL statement that you fired, and that data also resides in the database in proper table. Yet resultSet.next() is always returning false. 

The retrieved resultSet actually points initially to a location before the actual data index, so with first resultSet.next() call, the resultSet pointer now points to the first fetched record in the database. This is ridiculous and had wasted more time. Actually I failed tocommit the data after inserting into the table. Without committing, that data never is written to the database schema. So check, did you really do a 
SQL> commit;
After scorching my head for over hours for these 7 characters of wisdom ( c-o-m-m-i-t-; ), I unleashed the forgotten thing: DML commands need to be committed/rolled-back for changes to take effect.

Thursday, 9 January 2014

Autofill Date in Excel Sheet columns

Hope everyone aware of filling Numeric values and filling Numeric series in Excel sheet(Microsoft). We can achieve filling Numeric values by just dragging the particular cell and filling Numeric Series by dragging the particular cell along pressing 'Ctrl' Key.

Filling Numeric value '1' from cells B2 to B11
Filling Numeric value '1' from cells B2 to B11


Filling Numeric series - '1 to 10' from cells B2 to B11
But what shall we do to fill Date values in excel columns.This can be achieved by dragging the cell by right clicking. You can choose either Day,Week,Month and Year.


Step-1

Step-2






Wednesday, 24 July 2013

Why should Main method in Java carry public static and void in its syntax always?

public static void main(String args[])

Every java programmer wondered to follow the syntax for main method as mentioned above. This is the reason behind the syntax. 

Why public - The access specifier of Main method is said to be public so that main method can be called outside of the class . This makes sure that JVM can easily access and execute the main method.

Why static - Main method is declared static so that JVM can call the main method with out creating instance for it. [While JVM tries to execute java program, it does not know how to create instance as there is no standard constructor defined for Main class].

Why void  - This is to make sure that Main method is not returning any values.

Cheers! Happy coding!


Thursday, 14 February 2013

Shortcut Keys - saves your time

     Most of us know that "Print Scrn" button in our keyboard will help us to take snapshots of the  screen. It will be more useful in case of developers and people who are working from different places to share their outputs, issues and bugs they are facing. But the 'Print Scrn' button will provide you with the entire screen's snap. What if we want to have the specific screen alone leaving the rest of screens behind. In windows, we can make use of 'Alt' key along with 'Print Scrn' to take screen shot of our own specific window.


Good to know :- Alt+0169 will help you to type copyright symbol. Alt+0169 ==>> ©. We have to keep on pressing 'Alt' while entering 0169 to do this.