Following SQL syntax can be used to group data using expression.
select date(added_time) as a,count(*) from test_table group by a
This will group data by date and display its count. It doesn't work grouping with expression, So need to use alias naming for expression.
In JAVA, you can use retrieve information about resultset using following code.
String str ="select * from table001"; ResultSet rs = st.executeQuery(str); ResultSetMetaData rsmd = rs.getMetaData(); System.out.println("Number of columns - " + rsmd.getColumnCount()); System.out.println("JAVA data type for Table field 3 - "+rsmd.getColumnClassName(3)); System.out.println("Database Table field 3 type - "+rsmd.getColumnTypeName(3));
In some cases, you have to send additional parameters with the action forwarding. Following code snip can be used to set additional parameters in the action class of the struts. ActionRedirect redirect = new ActionRedirect(mapping.findForward(forwardPage)); redirect.addParameter("username", "user"); redirect.addParameter("password", "PWD"); return redirect;
Following Linux command can be used to find files which contains specific words. For example, if you need to search files which contain word "test", you can use the following command.
When it is creating multiple reports by threads in Jasper, you will get "Grid Layout Exception" occurred by the jasper library. To avoid that, you can add the following property to JVM.