Posts

Showing posts from 2019

JSP Mysql Delete

https://www.studentstutorial.com/java-project/jsp-delete-data.php

JSP Login Page

This article is a series of  JSP Tutorial .  In this article, we will build a simple Login Form using JSP , JDBC and MySQL database. In this example, we will write JDBC code separate from the JSP page. JSP page we will be using only for presentation. Let me list out the tools and technologies that I have used to develop this application. You can download the source code of this article from my GitHub repository. The link has given at end of this article. In this article, we will design below the Login Form  JSP page and store Form parameters into the MySQL database: Resource:  https://www.javaguides.net/2019/01/jsp-login-form-jdbc-mysql-example.html

Connect java to MySQL

To connect Java application with the MySQL database, we need to follow 5 following steps. In this example we are using MySql as the database. So we need to know following informations for the mysql database: Driver class: The driver class for the mysql database is com.mysql.jdbc.Driver . Connection URL: The connection URL for the mysql database is jdbc:mysql://localhost:3306/sonoo where jdbc is the API, mysql is the database, localhost is the server name on which mysql is running, we may also use IP address, 3306 is the port number and sonoo is the database name. We may use any database, in such case, we need to replace the sonoo with our database name. Username: The default username for the mysql database is root . Password: It is the password given by the user at the time of installing the mysql database. In this example, we are going to use root as the password. Resource:  https://www.javatpoint.com/example-to-connect-to-the-mysql-database

MySQL DATE_FORMAT() Function

MySQL  DATE_FORMAT()  Function ❮ MySQL Functions Example Format a date: SELECT  DATE_FORMAT( "2017-06-15" ,  "%Y" ); Try it Yourself » Definition and Usage The DATE_FORMAT() function formats a date as specified. Syntax DATE_FORMAT( date ,  format ) Resource:  https://www.w3schools.com/sql/func_mysql_date_format.asp

MySQL ROUND() Function

MySQL  ROUND()  Function ❮ MySQL Functions Example Round the number to 2 decimal places: SELECT  ROUND( 135.375 ,  2 ); Try it Yourself » Definition and Usage The ROUND() function rounds a number to a specified number of decimal places. Note:  See also the  FLOOR() ,  CEIL() ,  CEILING() , and  TRUNCATE()  functions. Syntax ROUND( number ,  decimals ) Resource: https://www.w3schools.com/sql/func_mysql_round.asp

MySql LOCATE() function

MySQL  LOCATE()  Function ❮ MySQL Functions Example Search for "3" in string "W3Schools.com", and return position: SELECT  LOCATE( "3" ,  "W3Schools.com" )  AS  MatchPosition; Try it Yourself » Definition and Usage The LOCATE() function returns the position of the first occurrence of a substring in a string. If the substring is not found within the original string, this function returns 0. This function performs a case-insensitive search. Note:  This function is equal to the  POSITION()  function. Syntax LOCATE( substring ,  string ,  start ) Resource: https://www.w3schools.com/sql/func_mysql_locate.asp

Mysql SUBSTRING() function

MySQL  SUBSTRING()  Function ❮ MySQL Functions Example Extract a substring from a string (start at position 5, extract 3 characters): SELECT  SUBSTRING( "SQL Tutorial" ,  5 ,  3 )  AS  ExtractString; Try it Yourself » Definition and Usage The SUBSTRING() function extracts a substring from a string (starting at any position). Note:  The  SUBSTR()  and  MID()  functions equals to the SUBSTRING() function. Syntax SUBSTRING( string ,  start ,  length ) OR: SUBSTRING( string  FROM  start  FOR  length ) Resource:  https://www.w3schools.com/sql/func_mysql_substring.asp

Mysql LEFT() function

MySQL  LEFT()  Function ❮ MySQL Functions Example Extract 3 characters from a string (starting from left): SELECT   LEFT ( "SQL Tutorial" ,  3 )  AS  ExtractString; Try it Yourself » Definition and Usage The LEFT() function extracts a number of characters from a string (starting from left). Tip:  Also look at the  RIGHT()  function. Syntax LEFT( string ,  number_of_chars ) Resource: https://www.w3schools.com/sql/func_mysql_left.asp

Mysql concat_ws() function

MySQL  CONCAT_WS()  Function ❮ MySQL Functions Example Add several expressions together, and add a "-" separator between them: SELECT  CONCAT_WS( "-" ,  "SQL" ,  "Tutorial" ,  "is" ,  "fun!" )  AS  ConcatenatedString; Try it Yourself » Definition and Usage The CONCAT_WS() function adds two or more expressions together with a separator. Note:  Also look at the  CONCAT()  function. Syntax CONCAT_WS( separator ,  expression1 ,  expression2 ,  expression3 ,...) Resource: https://www.w3schools.com/sql/func_mysql_concat_ws.asp

Select multiple tables (normal approach)

example SELECT name , price , photo FROM drinks , drinks_photos WHERE drinks . id = drink_photos.drinks_id https://stackoverflow.com/questions/12890071/select-from-multiple-tables-mysql

Mysql having clause

The SQL HAVING Clause The HAVING clause was added to SQL because the WHERE keyword could not be used with aggregate functions. HAVING Syntax SELECT column_name(s) FROM table_name WHERE condition GROUP BY column_name(s) HAVING condition ORDER BY column_name(s); Resource: https://www.w3schools.com/sql/sql_having.asp
Loading...

video about composition and aggregation

Image

Reversion Java santai

https://www.codingame.com/ide/puzzle/onboarding

Tutorial OOP(reversion java)

Reversion exercise for java. Please answer all questions in paper. Without using IDE. 30 minutes is allocate for this exercise. Get the questions in the link below. Java Reversion Exercise emailkan ke: arizalshamsil89@gmail.com subject: OOPReversion(no Matrik)