Java High level programming language ◦ Sun Microsystems ◦ ORACLE acquired Java Development Kit – JDK Java Runtime Environment – JRE Java Virtual Machine – JVM ◦ Bytecode ◦ Cross-platform
Java Java programs are referred to differently, depending on the platform on which they’re running: ◦ A Java program running on a web page is called an applet. ◦ A Java program running on a server is called a servlet. ◦ A Java program running on a computer alone is called an application.
Command Line Demo Hello World
Java Java Libraries ◦ Jar files Classpath concept ◦ compile time ◦ run time Java API ◦ Application Programming Interface ◦
JDBC Java Database Connectivity ◦ an API for the Java programming language that defines how a client may access a databaseAPIJava programming languagedatabase database-independent connectivity between the Java programming language and a wide range of databases JDBC Drivers ◦ Open source ◦ Commercial
Command Line Demo Hello JDBC java -cp.:./mysql-connector-java bin.jar HelloJDBC MySQL-Connector is a JDBC driver supporting connection with MySQL
IDE Integrated Development Environment ◦ provides comprehensive facilities to computer programmers for software developmentcomputer programmerssoftware development Eclipse, Netbeans
Eclipse Demo Hello World and Hello JDBC
9 XML Extensible Markup Language has become the “universal” standard for representing data XML started out as a standard data exchange format for the Web Yet, it has quickly become the fundamental instrument in the development of Web-based online information services and electronic commerce applications Almost all recent electronic commerce standards are based on XML
10 Giving Meaning and Structure to Data 1234ABCD … Start Tag An Element An Attribute Another Element End Tag Data
XML Nazim Devren AA Deniz Akinci AA
XML - Tree Representation Database Student Row idnamecoursegrade Nazim Evren AA Element NodeText Node NODE
How to parse? Parsing means: ◦ XMLString Object Manually (Not recommended ) Java Libraries ◦ xml4j ◦ dom4j ◦ xerces ◦ JAXB – Java XML Binding Read the API specification of your library
XSD – XML Schema XML Schema describes the structure of an XML document. ◦ combination of grammatical rules governing the order of elements ◦ Boolean predicates that the content must satisfy Boolean predicates ◦ data types governing the content of elements and attributes ◦ specialized rules such as uniqueness and referential integrity constraints XML Validation
Java Servlets Web ◦ Static: HTML ◦ Dynamic: PHP, ASP, JSP, Servlets HTTP ◦ Methods of HTTP ◦ Importance of protocols A Servlet is a Java class which conforms to the Java Servlet API, a protocol by which a Java class may respond to http requests.Java classhttp A Servlet is an object that receives a request and generates a response based on that request.Servletobject
Eclipse Demo Simple Servlet
Servlet Containers Non-commercial and commercial ◦ Apache Tomcat, Apache Geronimo, Glassfish, Jetty, Jboss, WebSphere etc… Servlets can be generated through JSP WAR – Web Archive ◦ Attention while submitting ◦ Demonstrate on Tomcat
Ant and Maven2 Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects.automating software buildMakeJava Maven is a software tool for Java project management and build automation. It is similar in functionality to the Apache Ant tool, but is based on different concepts.Javabuild automationApache Ant Ant is imperative whereas Maven is declarative
Ant Demo
First Programming Assignment Coming on Friday…