I am a big fan of spring frame work.When i started working with spring long ago it is very difficult to configure a web application using it.In order to run a simple web application spring framework needs a Lot of xml configuration .I personally hate xml configuration any way the spring evaluation brings the concept of annotation that makes our life more easy and smooth . Time gone spring boot came to picture it makes life little more easier. using a single run command we can up a web application. I recently came across a grate another opensource spring generator called JHipster.The official website says "JHipster is a development platform to generate, develop and deploy Spring Boot + Angular/React Web applications and Spring microservices." Yes it is supper easy to generate spring project using JHipster it could be a standalone web service or a Web application. using this tool we can configure any kind of application in less than couple of minutes.
a simple example for PreparedStatement package basics.in.java.blogspot.in; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { private static final String USERNAME="root"; private static final String PASSWORD=""; private static final String CONN_STRING="jdbc:mysql://localhost/basicsinjavablogspot"; public static void main(String[] args) throws ClassNotFoundException, SQLException { Class.forName("com.mysql.jdbc.Driver"); Connection conn=null; Statement stmt=null; ResultSet rs=null; try { conn= DriverManager.getConnection(CONN_STRING, USERNAME, PASSWORD); System.out.println("database connection successful"); //stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); String sql="select * fr...
Comments
Post a Comment