First day of basic Java learning

Source: Internet
Author: User

Download the JDK and install and modify the environment variables.
D:\java\worktool\jdk1.8.0_171
C:\Program Files (x86) \common Files\oracle\java\javapath;%systemroot%\system32;%systemroot%;%systemroot%\system32 \wbem;%systemroot%\system32\windowspowershell\v1.0\;%java_home%/bin
View the Java version and path after the environment configuration
Code Writing
public class hello{
/*
Program entry
/
public static void main{string[] arg}
{
System.out.println ("Hello World");

}
}
Practice of Database programming
Import java.sql.*;
public class update{
public static void Update (int catno,int empNo)
Throw sqlexception{
Connection Con=null;
PreparedStatement Psmt=null;
try{
Con=drivermanger.getconnection ("Jdbc:default:connection");
Psmt=con.preparedstatement ("UPDATE EMPLOYEES" + "SET car_number=?") + "WHERE");
Psmt.setint (1,carno);
Psmt.setint (2,empno);
Psmt.executeupdate ();
}
finally{
If{psmt!=null}
Psmt.close ();
}

Connection Con=null;

}
}
Evening plan more contact socket exercises, as well as database connection exercises
Come on, old iron.

First day of basic Java learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.