MySQL database provides a wonderful feature of
Autoincrement Column index. Your database table can define its primary key as Autoincrement number and MySQL will take care of its unique value while inserting new rows.Each time you add a new row, MySQL increments the value automatically and persist it to table. But sometime you may want ...
JavaServer Tag library is one of the most used JSP tag library out there. I have used it almost in all of my JEE based projects. The best feature probably is the Iterator API in JSTL tag library.Here is a small code snippet which you might not know. Its very easy to iterate Lists using JSTL. For example://Java List<String> cityList = new ArrayList<String>(); cityList.add("Washington DC"); cityList.add("Delhi"); cityList.add("Berlin"); cityList.add("Paris"); cityList.add("Rome");request.setAttribute("cityList", cityList);//JSP <c:forEach ...
While writing code in jQuery, I often use .text() method to get the content of any element from DOM. This function is straight forward, it strips off all the html element from a selected element and returns the remaining text.So for below element the .text() method will return "A quick brown fox".<div id="foo"> A quick brown fox </div> <script> $("#foo").text(); ...
While working with Doubles and Long numbers in Java you will see that most of the value are displayed in Exponential form.For example : In following we are multiplying 2.35 with 10000 and the result is printed.//Division example Double a = 2.85d / 10000; System.out.println("1) " + a.doubleValue());//Multiplication example a = 2.85d * 100000000; System.out.println("2) " + a.doubleValue());Result:1) 2.85E-4 2) 2.85E8Thus you can see the result is ...
Update: The plugin is now on GitHub:
https://github.com/viralpatel/jquery.shortenFacebook user updates has a great functionality. If the comment text is larger than few characters, the extra words are hide and a show more link is presented to user. This way you can keep long text out of the view to user and stop the ...
Almost all the user interfaces that I have created had this functionality of selecting multiple items from a list to process them or delete them. Although its very very easy to implement this functionality in Javascript, using jQuery for this is real fun. I will show you a simple implementation of adding multiple checkbox select and ...
As a Java developer, lot of times I have to play around with file system. Sometimes I have to copy files/directories from one location to another; sometimes have to process certain files depending on certain pattern. In one of my test program, I wanted to calculate available disk space using Java. Lot of code snippets are ...
Here is a small but very useful tip that every Java programmer should be aware of. Have you ever tried sorting arrays in Java? Well, java.util.Arrays class has built in method to make your job easy. You can use following method to sort any array in Java.import java.util.Arrays; ... ... Arrays.sort (int ) Arrays.sort (float ) Arrays.sort (long ) ...Let us check an example were we will sort an array of ...
Most of the times, production data is not available in development environments. Here, I would like to share a single sql command which can generate random data. But before that, let's address another issue faced by a lot of new oracle users. We need to generate a sequence of numbers using a sql statement. This will generate a number sequence. ...
Deleting duplicate rows from tables is one of the common task oracle developers come across. The data might get duplicated because of missing primary/unique key on the table or batch file getting loaded multiple times. Here I have tried to summarize different ways of deleting this duplicated data. Please note that this is not an extensive list ...