Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Articles by Giri Raju
Page 5 of 7
How to create a dynamic 2D array in Java?
If you wish to create a dynamic 2d array in Java without using List. And only create a dynamic 2d array in Java with normal array then click the below linkYou can achieve the same using List. See the below program. You can have any number of rows or columns.Exampleimport java.util.ArrayList; import java.util.List; public class Tester { public static void main(String[] args) { List rows = new ArrayList(); rows.add(new int[]{1, 2, 3}); rows.add(new int[]{1, 2}); rows.add(new int[]{1}); //get element at row : 0, column ...
Read Morejava access modifiers with method overriding
Yes, an overridden method can have a different access modifier but it cannot lower the access scope.The following rules for inherited methods are enforced -Methods declared public in a superclass also must be public in all subclasses.Methods declared protected in a superclass must either be protected or public in subclasses; they cannot be private.Methods declared private are not inherited at all, so there is no rule for them.
Read MoreHow can I change the default sort order of MySQL tables?
As we know that when we use ORDER BY Clause, the default sort order of MySQL table is ascending, start with the smallest value. We can change this default order by using DESC keyword along with ORDER BY Clause. The following example will clarify this concept −>mysql> Select * from STUDENT ORDER BY Name DESC; +--------+--------+--------+ | Name | RollNo | Grade | +--------+--------+--------+ | Gaurav | 100 | B.tech | | Aryan | 165 | M.tech | | Aarav | 150 | M.SC | +--------+--------+--------+ 3 rows in set (0.00 sec)We can see that after using the keyword DESC the default order has been changed from ascending to descending.
Read MoreFinding the table from which data is fetched in SAP
You can get the data if it is displayed in a transaction. Here are the steps you need to follow.a) First point the cursor on the field for which you want to get the data.b) Press F1 for help. This will open a dialog with heading “Performance assistant”c) Click on the “Technical information” button. This will open up another dialog boxd) You will be able to find “Table name” and “Field name”Generally, this will tell you the table in the database .If you are not able to get the required information, run a trace using ST05. In SAP system, SQL trace ...
Read MoreHow to write a MySQL stored function that inserts values in a table?
As we know that function is best used when we want to return a result. Hence, when we will create stored functions for manipulating tables like to Insert or Update values then it would be more or less like stored procedures.ExampleIn the following example we are creating a stored function named ‘tbl_insert’ which will insert the values in a table named ‘student_marks’.mysql> Create Function tbl_insert(S_name Varchar(50), M1 INT, M2 INT, M3 INT, M4 INT) -> RETURNS INT -> DETERMINISTIC -> BEGIN -> INSERT INTO student_marks values(S_name, M1, M2, M3, M4); ...
Read MoreHow can I restore a database dumped by mysqldump?
Suppose if we have dumped the whole database and now want to restore it then we can do it with the following example −C:\mysql\bin>mysql -u root query < tutorials.sqlWith the help of above query, we are restoring the dumped database named ‘tutorials’, in the file tutorials.sql, into other database named ‘query’. It means that the tables of database ‘tutorials’ would be restored in a database named ‘query’.
Read MoreHow can we use the MySQL reserved words as an identifier?
We must have to use quotes with reserved words to use them as an identifier. The quotes can be single or double depends upon ANSI_QUOTES SQL mode.If this mode is disabled then the identifier quote character is the backtick (“`”). Consider the following example in which we created a table named ‘select’ −mysql> create table `select`(id int); Query OK, 0 rows affected (0.19 sec)If this mode is enabled then we can use backtick (“`”) and double quotes (“”) both as identifier quote character. Consider the following example in which we created a table named ‘trigger’ −mysql> Create table "trigger" (id ...
Read MoreFont size adjust of an element with CSS
This property enables you to adjust the x-height to make fonts more legible. Possible value could be any number.Example Asia is a continent.
Read MoreUsage of font-style property in CSS
The font-style property is used to make a font italic or oblique. You can try to run the following code to set the font-style property: This text will be rendered in italic style
Read MoreWhat MySQL returns on passing an invalid string as an argument to STR_TO_DATE() function?
If we pass an invalid string as an argument to STR_TO_DATE() function then MySQL will return NULL as output along with a warning. Following is an example to understand the same −mysql> Select STR_TO_DATE('20173210', '%Y%d%m'); +-----------------------------------+ | STR_TO_DATE('20173210', '%Y%d%m') | +-----------------------------------+ | NULL | +-----------------------------------+ 1 row in set, 1 warning (0.00 sec)In the query above the string value is invalid because of wrong (32) day value. Hence it returns NULL values and a warning which is given below.mysql> Show warnings\G *************************** 1. row *************************** ...
Read More