Can I find out the next auto_increment to be used?

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
Yes, you can find out the next auto_increment with SELECT AUTO_INCREMENT as shown in the below syntax −SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= yourDatabaseName AND TABLE_NAME=yourTableName;Let us first create a table −mysql> create table DemoTable (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientName varchar(20),    ClientAge int ); Query OK, 0 rows affected (1.33 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ClientName, ClientAge) values('John', 23); Query OK, 1 row affected (0.35 sec) mysql> insert into DemoTable(ClientName, ClientAge) values('Carol', 21); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable(ClientName, ClientAge) values('Bob', ... Read More

What is Kamal Hassan offering Tamil Nadu?

Ananya K
Updated on 30-Jul-2019 22:30:25
While launching his political party 'Makkal Needhi Maiam', the famous Indian Actor Kamal Haasan says that "We are social servants. Look at me as a lamp and light in your homes. This lamp won't flicker to the winds of corruption".He calls his party "Makkal Needhi Maiam" meaning "People's Justice Forum". Here are the five key promises he made about what his party is offering to the people of Tamil Nadu.Quality EducationCorruption Free stateRemove Religious and Caste differencesParty works in the center and he will bring together all the south Indian statesHe said the party will not have a permanent chief ... Read More

SecureRandom nextBytes() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
The number of random bytes as specified by the user can be obtained using the nextBytes() method in the class java.security.SecureRandom. This method requires a single parameter i.e. a random byte array and it returns the random bytes as specified by the user.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          String s = "Apple";          byte[] arrB = s.getBytes();         ... Read More

How to use Singleton Alert Dialog in android?

Nitya Raut
Updated on 30-Jul-2019 22:30:25
Before getting into example, we should know what singleton design pattern is.  A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency, and creating a central point of access for an application to access its data store.This example demonstrates How to use Singleton Alert Dialog in androidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we ... Read More

Create an aggregate checksum of a column in MySQL

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
You can use CRC32 checksum for this. The syntax is as follows −SELECT SUM(CRC32(yourColumnName)) AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table CRC32Demo    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> UserId varchar(20)    -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into CRC32Demo(UserId) values('USER-1'); Query OK, 1 row affected (0.38 sec) mysql> insert into CRC32Demo(UserId) values('USER-123'); Query OK, 1 row ... Read More

What is a include directive in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The include directive is used to include a file during the translation phase. This directive tells the container to merge the content of other external files with the current JSP during the translation phase. You may code the include directives anywhere in your JSP page.The general usage form of this directive is as follows −

How to iterate over nodes of XML in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The tag is used to loop over nodes in an XML document.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultselectThe XPath expression to be evaluatedYesNonevarName of the variable to store the current item for each loopNoNonebeginThe start index for the iterationNoNoneendThe end index for the iterationNoNonestepThe size of the index increment while iterating over the collectionNoNonevarStatusThe name of the variable in which the status of the iteration is storedNoNoneExampleThe following example shows the use of the tag −           JSTL x:if Tags               Books Info:     ... Read More

LocalTime format() method in Java

Daniol Thomas
Updated on 30-Jul-2019 22:30:25
The LocalTime can be formatted with the specified formatter using the format() method in the LocalTime class in Java. This method requires a single parameter i.e. the LocalTime object to be formatted and it returns the formatted LocalTime with the specified formatter.A program that demonstrates this is given as follows:Example Live Demoimport java.util.*; import java.time.*; import java.time.format.DateTimeFormatter; public class Main {    public static void main(String[] args) {       LocalTime lt = LocalTime.parse("14:30:47");       System.out.println("The LocalTime is: " + lt);       DateTimeFormatter dtf = DateTimeFormatter.ISO_TIME;       System.out.println("The formatted LocalTime is: " + dtf.format(lt)); ... Read More

Fetch the value from an Octet Tuple in Java

Smita Kapse
Updated on 30-Jul-2019 22:30:25
To fetch the value from an Octet Tuple, use the getValueX() method. Here X is the index for which you want the value.For example, to fetch the 5th element i.e. 4th index, use the getValueX() method as −getValue(4);Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. ... Read More

DATEADD or DATE_ADD in MySQL query?

Ankith Reddy
Updated on 30-Jul-2019 22:30:25
You need to use DATE_ADD() in MySQL.The syntax is as followsDATE_ADD(NOW(), INTERVAL yourValue MINUTE);Arithmetic operator can also be used.The syntax is as followsNOW() + INTERVAL 30 MINUTEHere is the demo of DATE_ADD() function.The query is as followsmysql> select date_add(now(), interval 30 minute);The following is the output+-------------------------------------+ | date_add(now(), interval 30 minute) | +-------------------------------------+ | 2019-02-27 15:38:27                 | +-------------------------------------+ 1 row in set (0.00 sec)Let us now use arithmetic + operator instead of DATE_ADD().The query is as followsmysql> select now(); +---------------------+ | now() ... Read More
Advertisements