Spring Framework Cookbook - Java Code Geeks

2y ago
45 Views
11 Downloads
8.08 MB
194 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Fiona Harless
Transcription

Spring Framework CookbookiSpring Framework Cookbook

Spring Framework CookbookiiContents1Spring Framework Best Practices11.1Define singleton beans with names same as their class or interface names . . . . . . . . . . . . . . . . . . . . .11.2Place Spring bean configuration files under a folder instead of root folder . . . . . . . . . . . . . . . . . . . . .11.3Give common prefixes or suffixes to Spring bean configuration files . . . . . . . . . . . . . . . . . . . . . . . .21.4Avoid using import elements within Spring XML configuration files as much as possible . . . . . . . . . . . . .21.5Stay away from auto wiring in XML based bean configurations . . . . . . . . . . . . . . . . . . . . . . . . . . .21.6Always externalize bean property values with property placeholders . . . . . . . . . . . . . . . . . . . . . . . .31.7Select default version-less XSD when importing namespace definitions . . . . . . . . . . . . . . . . . . . . . . .31.8Always place classpath prefix in resource paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41.9Create a setter method even though you use field level auto wiring . . . . . . . . . . . . . . . . . . . . . . . . .41.10 Create a separate service layer even though service methods barely delegate their responsibilities to corresponding DAO methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41.11 Use stereotype annotations as much as possible when employing annotation driven bean configuration . . . . . .51.12 Group handler methods according to related scenarios in different Controller beans . . . . . . . . . . . . . . . .61.13 Place annotations over concrete classes and their methods instead of their interfaces . . . . . . . . . . . . . . . .61.14 Prefer throwing runtime exceptions instead of checked exceptions from service layer . . . . . . . . . . . . . . .61.15 Manage transactions only in the service layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71.16 Mark transactions as readOnly true when service methods only contain queries . . . . . . . . . . . . . . . . . .71.17 Be aware of false positives in transactional ORM integration tests . . . . . . . . . . . . . . . . . . . . . . . . .81.18 Do not use DriverManagerDataSource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81.19 Either use NamedParameterJdbcTemplate or JdbcTemplate for your JDBC operations . . . . . . . . . . . . . . .91.20 Use SessionFactory and EntityManager directly in your DAO beans . . . . . . . . . . . . . . . . . . . . . . . .91.21 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102Spring 4 Autowire Example112.1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2Usage of Autowire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3Step by Step Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3.1Create the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.3.2Configure POM.xml (maven) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Spring Framework Cookbook2.43iii2.3.3Create Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3.4Configure beans (applicationContext.xml) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.3.5Create the class that will use (injection) the service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.3.6Test it Out! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Download the Eclipse project of this tutorial: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15How to write Transactional Unit Tests with Spring163.1Create a new Maven Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2Add necessary dependencies in your project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.3Create log4j.xml file in your project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.4Prepare DDL and DML scripts to initialize database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.5Write Domain Class, Service and DAO Beans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.6Configure Spring ApplicationContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.7Write a transactional integration unit test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.8Run the tests and observe the results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.9Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.10 Download the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314Spring Framework JMSTemplate Example324.1Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.2Sending and Receiving Messages without JmsTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.3Configuring JmsTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.4Using JMSTemplate to produce messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.5Using JMSTemplate to consume messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.6Complete JmsTemplate example to send/receive messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.7JmsTemplate with Default destination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.8JmsTemplate with MessageConverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.9Configuring MessageConverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.10 Download the Eclipse Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455How to Start Developing Layered Web Applications with Spring465.1Create a new Maven WebApp project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465.2Add necessary dependencies in your project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515.3Create log4j.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565.4Prepare DDL and DML scripts to initialize database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.55.4.1schema.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.4.2data.sql . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Write Domain Class, Service and DAO Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.5.1Person.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575.5.2PersonDao.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

Spring Framework Cookbook5.65.7iv5.5.3JdbcPersonDao.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585.5.4PersonService.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605.5.5PersonServiceImpl.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Write Controller Classes and JSPs to handle UI logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615.6.1PersonListController and personList.jsp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615.6.2PersonCreateController and personCreate.jsp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635.6.3PersonUpdateController and personUpdate.jsp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645.6.4PersonDeleteController and personDelete.jsp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66Configure your web application to bootstrap with Spring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675.7.1WebAppConfig.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675.7.2WebAppInitializer.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685.8Configure your IDE to run Tomcat instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.9Run Tomcat instance and access your webapp through your browser . . . . . . . . . . . . . . . . . . . . . . . . 745.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 755.11 Download the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756Angularjs and Spring Integration Tutorial6.1What is Spring? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766.2What Is Angular? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766.3Create a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766.478766.3.1Maven dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776.3.2Web app java-based configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3.3SpringMVC controller and jsp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.4Angularjs controllers and js files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.3.5Build and run the application on tomcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82Download the source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Spring MVC Application with Spring Security Example847.1Introduction to Spring Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847.2Project Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 847.3Project Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877.4Download the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93Spring MVC Hibernate Tutorial948.1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 948.2Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 948.3Spring MVC Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 948.4Hibernate For Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958.5Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958.5.1Maven Project and POM dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Spring Framework Cookbookv8.5.2Configure Hibernate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1008.5.3Domain Entity Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018.5.4Service Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038.5.5DAO Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1058.5.6Configure Spring MVC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078.5.7Initializer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1088.5.8Application Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1088.5.9Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1118.5.10 Deploy and running the app . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11398.6Download . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1148.7Related Articles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114Spring rest template example9.1115Download the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11810 Spring data tutorial for beginners11910.1 Output: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12510.2 Download the Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12611 Spring Batch Tasklet Example12711.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12711.2 Spring Batch Framework: Key Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12711.2.1 Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12711.2.2 Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12811.2.2.1 ItemReader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12911.2.2.2 ItemProcessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12911.2.2.3 ItemWriter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12911.2.2.4 Chunk Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12911.2.2.5 TaskletStep Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13011.2.3 Tasklet Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13111.2.3.1 Tools used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13111.2.3.2 Create a Maven Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13111.2.3.3 Add Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13511.2.3.4 Add db2* jars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13611.2.3.5 HSQL Table Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13611.2.3.6 Supply Sample Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13611.2.3.7 Data Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13711.2.3.8 RowMapper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13811.2.3.9 Tasklet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13811.2.3.10 Job Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

Spring Framework Cookbookvi11.2.3.11 Context Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14111.2.3.12 Properties File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14211.2.3.13 Run the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14211.2.3.14 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14311.2.4 Download Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14312 Spring Boot Tutorial for beginners14412.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14412.2 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14412.3 Sample Application using Spring Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14412.3.1 Create and configure a Gradle project in Eclipse IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14412.3.2 build.gradle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15112.3.2.1 Modify build.gradle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15112.3.2.2 Walk through build.gradle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15212.3.2.3 Run initial build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15312.3.3 Create SampleApplication.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15312.3.4 Create SampleController.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15812.3.5 SampleApplication.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16312.3.5.1 Modify SampleApplication.java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16312.3.6 Run SampleApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16312.4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16412.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16412.6 Download the Eclipse project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16513 Spring Session Tutorial16613.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16613.2 Project Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16613.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16813.3.1 Sticky Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16813.3.2 Single Sign On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17213.4 Download The Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17714 Spring Web Flow Tutoriall17814.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17814.2 Project Set-Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17814.3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17914.4 Download The Source Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

Spring Framework CookbookCopyright (c

Spring Framework Cookbook viii Preface The Spring Framework is an open-source application framework and inversion of control container for the Java platform. The framework’s core features can be use

Related Documents:

java.io Input and output java.lang Language support java.math Arbitrary-precision numbers java.net Networking java.nio "New" (memory-mapped) I/O java.rmi Remote method invocations java.security Security support java.sql Database support java.text Internationalized formatting of text and numbers java.time Dates, time, duration, time zones, etc.

Java Version Java FAQs 2. Java Version 2.1 Used Java Version This is how you find your Java version: Start the Control Panel Java General About. 2.2 Checking Java Version Check Java version on https://www.java.com/de/download/installed.jsp. 2.3 Switching on Java Console Start Control Panel Java Advanced. The following window appears:

SAP has developed a new radio frequency (RF) concept. This RF cookbook helps developers to begin working in the RF framework. It answers frequently asked questions and helps to avoid common errors. This RF cookbook also provides some useful tips about the standard layout and screen structure that should be applied in the standard transactions.File Size: 299KBPage Count: 59Explore further[PDF] SAP EWM RF Cookbook - Free Download PDFdlscrib.comEWM RF Cookbook SAP blog of John Kristensenjksap.wordpress.comRF Cookbook - Part I Description - SAP Communityarchive.sap.comRF Cookbook - Part I Descriptiondocshare01.docshare.tipsSAP EWM RF Framework - SlideSharewww.slideshare.netRecommended to you based on what's popular Feedback

Active Filter Cookbook, CMOS Cookbook, TTL Cook book, RTL Cookbook (out of print), TVT Cookbook, Cheap Video Cookbook, Son of Cheap Video, The Hex adecimal Chronicles, The Incredible Secret M

3. _ is a software that interprets Java bytecode. a. Java virtual machine b. Java compiler c. Java debugger d. Java API 4. Which of the following is true? a. Java uses only interpreter b. Java uses only compiler. c. Java uses both interpreter and compiler. d. None of the above. 5. A Java file with

2 Java Applications on Oracle Database 2.1 Database Sessions Imposed on Java Applications 2-1 2.2 Execution Control of Java Applications 2-3 2.3 Java Code, Binaries, and Resources Storage 2-3 2.4 About Java Classes Loaded in the Database 2-4 2.5 Preparing Java Class Methods for Execution 2-5 2.5.1 Compiling Java Classes 2-6

The basic Java framework to access the database is JDBC. Unfortunately, with JDBC, a lot of hand work is needed to convert a database query result into Java classes. In the code snippet bellow we demonstrate how to transform a JDBC query result into Car objects: import java.sql.*; import java.util.LinkedList; import java.util.List;

FINAL YEAR MEng PROJECT Reprap Colour Mixing Project James Corbett 1st May 2012 . make the technology widely available for home users and projects such as RepRap have become much more widespread. RepRap is an open source project started by Adrian Bowyer of Bath University in 2005 which was designed around the ideal of creating a low cost home printer that could self replicate a larger .