grab our rss feed  Follow us on twitter

s2sgateway

Practical Learning of Programming languages such us j2ee,java,jsp

To Download Our Web-Application Free E-book Enter your Mail Address Below

Enter your E-mail Address to Subscribe Tutorials and Free Projects:

  Powered by FeedBurner

Entries for the ‘my sql’ Category

pagination in jsp,java

ShareHai all today we are going to learn how to create a pagination in jsp.
Understanding Pagination is first of all important,Retrieving and showing 50 values in a page is not a problem if it is more than 100 or 200 values then page which is showing is too long and time to load so know [...]

Comments

Finding/removing duplicate values from database using sql

ShareToday we are going to learn how to exclude/remove the duplicate values from database.This is useful when you want to exclude the duplicate values and show only values that can’t be repeated in dropdownbox or whatever use.
There is a nice query out there look below
“select * from tablename group by fieldname having(count(*)>1)”
Here the values same [...]

Comments

Exception:com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column

ShareWhen you get this error while running jsp program “Exception in Upload.jsp–>com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘columnname’ at row 1″
The first thing to lookup is mysql database table columns datatype.
For uploading or inserting large images or texts you need to assign datatype as “blob or longblob”Then these errors are avoided.What we do [...]

Comments

How to backup database of mysql using bat

ShareToday we are going to learn how to backup a database using commands from mysql
The easy way to do this is using a bat file.
open notepad and type
mysqldump –user=root –password=root –lock-all-tables –opt databasename > c:/backup.sql
save this file in your mysql installed bin folder as “restore.bat” now double click it you will find database [...]

Comments

Create database and table from jsp page

ShareToday we are going to learn simple method to create the database and table from jsp code.
Just create a simple jsp page ex:create.jsp and paste the code below

<%@page import=”java.sql.*,java.io.*” %>
<%
Class.forName(”com.mysql.jdbc.Driver”);
Connection con=DriverManager.getConnection(”jdbc:mysql://localhost:3306/”,”root”,”root”);
PreparedStatement ps=con.prepareStatement(”create database s2sgateway”);
ps.executeUpdate();
PreparedStatement ps1=con.prepareStatement(”use s2sgateway”);
ps1.executeUpdate();
PreparedStatement ps2=con.prepareStatement(”create table new(name varchar(20))”);
ps2.executeUpdate();

%>
database created sucessfully
Table create successfully

After executing you could see a database named s2sgateway and a table [...]

Comments

Error Index out of range 3>2

ShareHere we are going to learn about reason behind the error index out of range.In application we use table for ex a table have two fields.we refer it using ResultSet as rs.getString(1),rs.getString(2) and so on,if you are using rs.getString(3) that is not available but you are referring it so it gives that error these type [...]

Comments

Loginform in JSP (Updated)

ShareIn this tutorial you are going to learn create a simple login form in jsp
create a table named “login” with username and password as two fields Note for msaccess give dsn as s2sgateway and for mysql database name as s2sgateway for this program to work or give your database name and change the code appropriately.
First [...]

Comments

Retrieve values between two numbers in mysql

ShareGuys today we are going to know how to retrieve the values between two specific numbers using mysql command.
See the example below
Get the id values in two numbers or simply assign it like n1=1,n2=5. Now use

select * from tablename where id BETWEEN ‘”+n1+”‘ AND ‘”+n2+”‘.

This will retrieve all table values from id=1 to 5. Any [...]

Comments

how to export a csv using INTO syntax of mysql

ShareGuys if you want to study mysql from scratch click the above mysql tab.
Here we are going to learn how to export a database table as a csv file in mysql.
Assuming you have a table “login” or just create a table login or whatever name.
Create table login(name varchar(20),pass varchar(20));
then insert some values.

In mysql console type [...]

Comments

My Sql

ShareThis site provide help to use mysql a open source in a better way keep visiting see Mysql page.

Comments