- Debugtomcatjbos
sEclipse - Tomcat
- AccessControlFo
rJMXConsole - EncryptingDataS
ourcePasswords - ConfigDataSourc
es - SetUpMysqlAsDef
aultDS - JBossAdminGuide
- BaseCertLoginMo
dule - LoginConfigurat
ion - SecureTheJmxCon
sole - JAASSetup
- CreateASimpleSe
curityDomainFor JBossSX - WARConfiguratio
n - SecureAWebAppli
cationUsingACus tomForm - SecureAWebAppli
cationInJBoss - SecureJBoss
- Security
- RMIClassLoading
Service - Technical White Paper - JBoss Security
- JBossClassLoadi
ngUseCases - ThreadDump
- VersionOfTomcat
InJBossAS - WebsphereMQInte
gration - UsingWebSphereM
QSeriesWithJBos sASPartI - UsingWebSphereM
QSeriesWithJBos sASPart2 - UsingWebSphereM
QSeriesWithJBos sASPart3 - UsingWebSphereM
QSeriesWithJBos sASPart4 - JBossMessaging
- JBossNS
- JBossWS
- IntegratingActi
veMQWithJBoss - Enhancements in Packages java.lang.* and java.util.*
- VirtualHosts
- SingleSignOn
- Scripting
- StartStopJBoss
- ServiceBindingM
anager - Logging
- JBossMonitoring
- JBossWSoverHTTP
S - TomcatClusterin
g - SSLSetup
- StartingWithSea
mAGuideForBegin ners - Twiddle
- UDDIExample
- HowDoIGetAnMDBS
ingleton - MessageTransfor
mation - ThreadDumpJSP
- WARConfiguratio
n - JBossSX
- LdapLoginModule
- MainDeployer
- LoggingRMICalls
- How to configure a Quartz service
- JBossProfiler
- ClassLeakage
- Receiving IllegalStateExc
eptions in client - ThreadSafeCode
- JBossJTA
- JBossJTAOvervie
w - DaylightSavings
TimeIssues - JBossRunParamet
ers - JBossConfigurat
ion - Log4jRepository
Selector - JBossDTDs
- EnableClassload
erLogging - LimitAccessToCe
rtainClients - MonitoringTomca
tEmbeddedInJbos s - GenerateAThread
DumpWithTheJMXC onsole - StartupAndDeplo
ymentCheck - CustomizingSecu
rityUsingValves - HttpSessionRepl
ication - PermanentGenera
tion - JBossMQLogging
- JBossConfigurat
ionFiles - ServerConfigura
tion - DeterminingClas
sVersionFromADo tClassFile - TimerService
- RemoveEJBTimer
- HowDoICreateARe
sourceRef - RetryingTransac
tions - AnIntroductionT
oJMX - ConfigMessaging
JDBC2Persistenc e - DynamicLoginCon
fig
Some of my experiences I want to share on Java related topics like xml, servlets, jms, ant etc.
Wednesday, October 22, 2008
JBOSS resources
WAS resources
Transactions in J2EE
Transactions in J2EE
WebSphere Web Services Information Roadmap
General information
Concepts, technology, and specifications
Developing Web services
Working with the Web Services Gateway
Web services security
Building solutions using Web services
Using Web Services for Business Integration
Chapter 1. Web services technology and standards
Chapter 2. Sample application
Chapter 3. WebSphere InterChange Server as a Web services router
Chapter 4. WebSphere BI Message Broker as a Web services router
Chapter 5. WebSphere Enterprise as a Web services router
Chapter 6. Process Choreographer as a Web services router
Appendix A. Hardware and software configuration
Appendix B. Additional material
Programming J2EE APIs with WebSphere Advanced
Part 1. Introduction
Chapter 1. Our development conditions
Chapter 2. J2EE overview
Chapter 3. Products used within this book
Chapter 4. Introducing PiggyBank
Part 2. The EJB container
Chapter 5. Working with Enterprise JavaBeans
Chapter 6. Transactions and EJBs
Chapter 7. Messaging with JMS, WebSphere and MQSeries
Part 3. The Web container
Chapter 8. Servlets
Chapter 9. JavaServer Pages
Chapter 10. JSPs extended: custom tags
Part 4. Additional discussions
Chapter 11. Application clients and J2EE communications
Chapter 12. Deploying J2EE applications to WebSphere
Appendix A. Additional material
Patterns: Service-Oriente d Architecture and Web Services
Chapter 1. Patterns for e-business
Chapter 2. Service-oriente d architecture
Chapter 3. Service-oriente d architecture and Patterns for e-business
Chapter 4. Service-oriente d architecture approach
Chapter 5. Technology options
Chapter 6. HTTP service bus
Chapter 7. JMS service bus
Chapter 8. Service directory
Chapter 9. Web service gateway
Chapter 10. e-business on demand and Service-oriente d architecture
Appendix A. Scenarios lab environment
Appendix B. Additional material
Self-Study Guide: WebSphere Studio Application Developer and Web Services
Part 1. Presentations
Unit 1. Workshop Introduction
Unit 2. Application Developer: Overview
Unit 3. Application Developer: Java Development
Unit 4. Application Developer: Relational Schema Center
Unit 5. Application Developer: XML Development
Unit 6. Application Developer: Web Development
Unit 7. Application Developer: EJB Development
Unit 8. Application Developer: Deployment to WebSphere
Unit 9. Application Developer: Profiling Tools
Unit 10. Application Developer: Team Development
Unit 11. Web Services Overview
Unit 12. Creating Web Services
Unit 13. Using Web Services
Unit 14. Web Services and the UDDI Explorer
Part 2. Exercises
Exercise 1. Java development
Exercise 2. Relational Schema Center
Exercise 3. XML development
Exercise 4. Web development
Exercise 5. EJB development
Exercise 6. Test and deploy using WebSphere AEs
Exercise 7. Profiling an application
Exercise 8. Create a Web Service
Exercise 9. Deploy and test a Web Service
Exercise 10. Using a Web service in a client application
Exercise 11. Web Service publishing in the UDDI registry
Part 3. Appendixes
Appendix A. Installation and configuration
Appendix B. Additional material
Patterns: SOA with an Enterprise Service Bus in WebSphere Application Server V6
Part 1. Patterns for e-business and SOA
Chapter 1. Introduction to Patterns for e-business
Chapter 2. SOA and the Enterprise Service Bus
Chapter 3. Application Integration and Extended Enterprise patterns
Chapter 4. Product descriptions and ESB capabilities
Chapter 5. SOA runtime patterns and Product mappings
Part 2. Business scenario and guidelines
Chapter 6. The business scenario that this book uses
Chapter 7. Technology options
Part 3. Scenario implementation
Chapter 8. SOA Direct Connection pattern
Chapter 9. Enterprise Service Bus pattern: router scenario
Chapter 10. Enterprise Service Bus pattern: broker scenario
Chapter 11. Exposed ESB Gateway pattern
Part 4. Appendixes
Appendix A. Additional material
Appendix B. Configuring the scenario environment
Connecting Enterprise Applications to WebSphere Enterprise Service Bus
Part 1. Background
Chapter 1. Connecting enterprise applications
Chapter 2. Service Component Architecture
Chapter 3. Connecting to the WebSphere Enterprise Service Bus
Chapter 4. Adapters
Part 2. Scenarios and patterns
Chapter 5. Business scenarios
Chapter 6. Connection patterns
Part 3. Working examples
Chapter 7. Historical integration using WebSphere MQ
Chapter 8. Custom CICS integration using WebSphere MQ
Chapter 9. Code-free CICS integration using WebSphere MQ
Chapter 10. Custom application integration using JMS
Chapter 11. Event-driven integration using a JDBC adapter
Chapter 12. Lightweight Web client integration using http
Chapter 13. Lightweight Web service integration using http
Chapter 14. Summary
Appendix A. Additional material
Appendix B. Source listings
Patterns: Implementing an SOA using an Enterprise Service Bus
Part 1. Patterns for e-business and SOA
Chapter 1. Introduction to Patterns for e-business
Chapter 2. e-business on demand and service-oriented architecture
Chapter 3. Web services and service-oriented architecture
Part 2. Enterprise Service Bus
Chapter 4. Enterprise Service Bus and SOA patterns
Chapter 5. ESB and SOA component implementations
Chapter 6. Endpoint enablement roadmap
Part 3. Scenario implementation
Chapter 7. The business scenario used in this book
Chapter 8. Enterprise Service Bus: Router variation
Chapter 9. Enterprise Service Bus: Broker variation
Chapter 10. Business Service Choreography
Chapter 11. Exposed ESB Gateway composite pattern
Appendix A. Additional material
Appendix B. Configuring the scenario lab environment
Patterns: SOA Design Using WebSphere Message Broker and WebSphere ESB
Chapter 1. Introduction
Part 1. Concepts, patterns, and products
Chapter 2. Introduction to SOA and ESB
Chapter 3. Product descriptions
Part 2. Product capabilities in relation to SOA and ESB
Chapter 4. ESB runtime patterns and product mappings
Chapter 5. WebSphere Enterprise Service Bus
Chapter 6. WebSphere Message Broker in SOA
Chapter 7. WebSphere DataPower appliances in SOA
Chapter 8. ESB design options
Part 3. Physical scenarios
Chapter 9. Scenario: using WebSphere ESB and WebSphere Message Broker in combination
Chapter 10. Scenario: DataPower in an SOA
Appendix A. Java node source code
Appendix B. Sample instructions
Appendix C. Additional material
WebSphere Version 6 Web Services Handbook Development and Deployment
Part 1. Web services concepts
Chapter 1. Web services introduction
Chapter 2. Web services standards
Chapter 3. Introduction to SOAP
Chapter 4. Introduction to WSDL
Chapter 5. JAX-RPC (JSR 101)
Chapter 6. Web Services for J2EE
Chapter 7. Introduction to UDDI
Chapter 8. Web Services Inspection Language
Chapter 9. Web services security
Chapter 10. Web services interoperabilit y
Chapter 11. Web services architectures
Chapter 12. Best practices
Part 2. Implementing and using Web services
Chapter 13. IBM products for Web services
Chapter 14. Sample application: Weather forecast
Chapter 15. Development overview
Chapter 16. Develop Web services with Application Developer V6.0
Chapter 17. Test and monitor Web services
Chapter 18. Deploy and run Web services in WebSphere Application Server V6.0
Chapter 19. Command-line tools, Ant, and multiprotocol binding
Part 3. Advanced Web services techniques
Chapter 20. Web services interoperabilit y tools and examples
Chapter 21. Securing Web services
Chapter 22. Web services and the service integration bus
Chapter 23. Implementing a private UDDI registry
Chapter 24. Web services caching
Appendix A. Installation and setup
Appendix B. WS-Security configuration details: Mapping V5/V6, predefined properties, sample forms
Appendix C. Additional material
Experience J2EE! Using WebSphere Application Server V6.1
Part 1. Preliminary activities
Chapter 1. Introduction
Chapter 2. Install and configure software
Chapter 3. Configure the development environment
Chapter 4. Prepare the legacy application
Part 2. Core J2EE application
Chapter 5. Create the employee data access element
Chapter 6. Create the funds data access element
Chapter 7. Create the donate business logic element
Chapter 8. Create the employee facade business logic element
Chapter 9. Create the Web front end
Chapter 10. Create the application client
Chapter 11. Implement core security
Chapter 12. Alternative Import the core J2EE application
Part 3. Web services
Chapter 13. Create the Web service
Chapter 14. Implement security for the Web service
Part 4. Messaging
Chapter 15. Create the message-driven bean
Chapter 16. Add publication of results
Chapter 17. Implement security for messaging
Chapter 18. What next?
Appendix A. Additional material
Web Services Feature Pack for WebSphere Application Server V6.1
Part 1. Introduction
Chapter 1. What is in the feature pack
Chapter 2. History and roadmap
Part 2. Benefits of the feature pack
Chapter 3. Business scenarios
Chapter 4. Facets and patterns
Chapter 5. Technical advantages
Part 3. Using the feature pack
Chapter 6. Installation
Chapter 7. JAX-WS programming model
Chapter 8. Policy sets
Chapter 9. Secure conversation
Chapter 10. Reliable messaging
Chapter 11. Interoperabilit y
Appendix A. Sample code
Appendix B. Additional material
Web Services Handbook for WebSphere Application Server 6.1
Part 1. Web services concepts
Chapter 1. Web services introduction
Chapter 2. Web services standards
Chapter 3. Introduction to SOAP
Chapter 4. Introduction to WSDL
Chapter 5. JAX-RPC (JSR 101)
Chapter 6. Web Services for J2EE
Chapter 7. Introduction to UDDI
Chapter 8. Web services security
Chapter 9. Web services interoperabilit y
Chapter 10. Web services architectures
Chapter 11. Best practices
Part 2. Implementing and using Web services
Chapter 12. IBM products for Web services
Chapter 13. Sample application: Weather forecast
Chapter 14. Development overview
Chapter 15. Develop Web services with Application Server Toolkit 6.1
Chapter 16. Test and monitor Web services
Chapter 17. Deploy and run Web services in WebSphere Application Server 6.1
Chapter 18. Command-line tools, Ant, and multiprotocol binding
Part 3. Advanced Web services techniques
Chapter 19. WS-Addressing and WS-Resource
Chapter 20. Web services transactions using WS-Coordination , WS-AtomicTransa ction and WS-BusinessActi vity
Chapter 21. Web services and the service integration bus
Chapter 22. WS-Notification
Chapter 23. Web services interoperabilit y tools and examples
Chapter 24. Implementing a private UDDI registry
Chapter 25. Securing Web services
Chapter 26. Web services caching
Appendix A. Installation and setup
Appendix B. Additional material
WebSphere MQ Version 6 and Web Services
Part 1. Overview
Chapter 1. Introduction
Chapter 2. Objectives
Chapter 3. Technologies
Part 2. Web Services and security considerations
Chapter 4. WebSphere Services with WebSphere MQ
Chapter 5. SOAP/WebSphere MQ implementation
Chapter 6. Security
Part 3. Implementing synchronous Web Services
Chapter 7. Environment setup
Chapter 8. Axis Web Service
Chapter 9. Axis client
Chapter 10. .NET Web Service
Chapter 11. .NET client
Chapter 12. WebSphere Application Server Web Service
Chapter 13. WebSphere Application Server client
Part 4. Asynchrony and transactionalit y
Chapter 14. Long-term asynchronous functionality (MA0V)
Chapter 15. Implementing long-term asynchronousWeb Service clients
Chapter 16. Transactional functionality (MA0V)
Chapter 17. Implementing transactionalit y
Part 5. Web Services and WebSphere MQ clustering
Chapter 18. Using WebSphere MQ clustering with Web Services
Appendix A. WebSphere MQ using .NET classes
Appendix B. WebSphere MQ using Java classes
Appendix C. Deployment utility quick reference
Appendix D. Additional material
Connecting Enterprise Applications to WebSphere Enterprise Service Bus
Part 1. Background
Chapter 1. Connecting enterprise applications
Chapter 2. Service Component Architecture
Chapter 3. Connecting to the WebSphere Enterprise Service Bus
Chapter 4. Adapters
Part 2. Scenarios and patterns
Chapter 5. Business scenarios
Chapter 6. Connection patterns
Part 3. Working examples
Chapter 7. Historical integration using WebSphere MQ
Chapter 8. Custom CICS integration using WebSphere MQ
Chapter 9. Code-free CICS integration using WebSphere MQ
Chapter 10. Custom application integration using JMS
Chapter 11. Event-driven integration using a JDBC adapter
Chapter 12. Lightweight Web client integration using http
Chapter 13. Lightweight Web service integration using http
Chapter 14. Summary
Appendix A. Additional material
Appendix B. Source listings
Enabling SOA Using WebSphere Messaging
Chapter 1. Introduction
Chapter 2. Product selection
Chapter 3. Runtime topology selection
Chapter 4. Application design
Chapter 5. Point-to-point runtime configuration
Chapter 6. Integration scenarios with WebSphere ESB
Chapter 7. Integration scenarios with WebSphere Message Broker
Appendix A. Sample files
MQSeries Programming Patterns
Part 1. Introduction
Chapter 1. Introduction and patterns
Chapter 2. Messaging and the APIs
Part 2. The APIs
Chapter 3. Programming with MQI
Chapter 4. Programming with AMI
Chapter 5. Programming with C++
Chapter 6. Programming with ActiveX
Chapter 7. Programming with Java
Chapter 8. Programming with JMS
MQSeries Workflow for Windows NT for Beginners
Chapter 1. Introduction
Chapter 2. Installation and configuration
Chapter 3. Using MQSeries Workflow - a tutorial
Chapter 4. Using MQSeries Workflow - next steps
Chapter 5. Programming using DB2 and Workflow APIs
Appendix A. OrderFulfillmen t.java
Appendix B. StartOrder.java
MQSeries Security: Example of Using a Channel Security Exit, Encryption and Decryption
WebSphere Application Server V6: Default Messaging Provider Problem Determination
WebSphere Application Server V6.1 Web Services Problem Determination
Introduction
Problems that occur during development
Problems deploying Web services applications
Problems that occur during runtime
Collecting diagnostic data
The next step
WebSphere Application Server V6.1: JMS Problem Determination
Chapter 1. Introduction to JMS problem determination
Chapter 2. Messaging engine problem determination
Chapter 3. Message store problem determination
Chapter 4. Message store with data store persistence
Chapter 5. File store problem determination
Chapter 6. JMS application problem determination
Chapter 7. Messaging in a multiple messaging engine environment
Chapter 8. Clustering problem determination
Chapter 9. Message-driven beans problem determination
Chapter 10. WebSphere MQ and MDBs
Chapter 11. WebSphere MQ Server problem determination
Chapter 12. WebSphere MQ configuration
Chapter 13. WebSphere MQ link problem determination
Chapter 14. JMS application with WebSphere MQ problem determination
Chapter 15. Foreign bus problem determination
Chapter 16. Mediation problem determination
Chapter 17. Default messaging provider security
Chapter 18. The next step
WebSphere Application Server V6.1: Classloader Problem Determination
Introduction to class loaders
Problem determination for class loader exceptions
ClassCastExcept ion
ClassNotFoundEx ception
NoClassDefFound Error
NoSuchMethodErr or and IllegalArgument Exception
UnsatisfiedLink Error
VerifyError
Configuring shared libraries
Using custom JAR files for your application
Collecting diagnostic data
The next step
WebSphere Application Server V6.1: Technical Overview
Not available.
WebSphere Application Server V6.1: System Management and Configuration
Part 1. The basics
Chapter 1. WebSphere Application Server
Chapter 2. System management: A technical overview
Chapter 3. Getting started with profiles
Chapter 4. Administration basics
Chapter 5. Administration with scripting
Chapter 6. Configuring WebSphere resources
Chapter 7. Managing Web servers
Part 2. Messaging with WebSphere
Chapter 8. Asynchronous messaging
Chapter 9. Default messaging provider
Part 3. Working with applications
Chapter 10. Session management
Chapter 11. WebSphere naming implementation
Chapter 12. Understanding class loaders
Chapter 13. Packaging applications
Chapter 14. Deploying applications
WebSphere Security Fundamentals
Chapter 1. Security fundamentals
Chapter 2. Supporting security components for WebSphere
Chapter 3. Security fundamentals for J2SE, J2EE, and WebSphere
IBM WebSphere Application Server V6.1 Security Handbook
Part 1. Application server security
Chapter 1. Introduction
Chapter 2. Configuring the user registry
Chapter 3. Administrative security
Chapter 4. SSL administration
Chapter 5. JAAS for authentication in WebSphere Application Server
Chapter 6. Application security
Chapter 7. Securing a Web application
Chapter 8. Securing an EJB application
Chapter 9. Client security
Chapter 10. Securing the service integration bus
Part 2. Extending security beyond the Application Server
Chapter 11. Security attribute propagation
Chapter 12. Securing a WebSphere application using Tivoli Access Manager
Chapter 13. Trust Association Interceptors and third party software integration
Chapter 14. Externalizing authorization with JACC
Chapter 15. Web services security
Chapter 16. Securing access to WebSphere MQ
Chapter 17. J2EE Connector security
Chapter 18. Securing the database connection
Part 3. Development environment
Chapter 19. Development environment security
Appendix A. Additional configurations
Appendix B. Additional material
Security in WebSphere Application Server V6.1 and J2EE 1.4 on z/OS
Chapter 1. Introduction
Chapter 2. WebSphere security design
Chapter 3. Web container security
Chapter 4. Application security
Chapter 5. Web services security introduction
Chapter 6. Web services message layer security
Chapter 7. Secure Sockets Layer (SSL)
Chapter 8. Web services transport security
Chapter 9. Security attribute propagation and CSIv2
Chapter 10. User registries
Chapter 11. SPNEGO and Windows single sign-on
Chapter 12. Operating system security
Chapter 13. WAS administrative security
Appendix A. Additional material
Rational Application Developer V7 Programming Guide
Part 1. Introduction to Rational Application Developer
Chapter 1. Introduction
Chapter 2. Programming technologies
Chapter 3. Workbench setup and preferences
Chapter 4. Perspectives, views, and editors
Chapter 5. Projects
Part 2. Develop applications
Chapter 6. RUP and UML
Chapter 7. Develop Java applications
Chapter 8. Accelerate development using patterns
Chapter 9. Develop Database Applications
Chapter 10. Develop GUI applications
Chapter 11. Develop XML applications
Chapter 12. Develop Web applications using JSPs and servlets
Chapter 13. Develop Web applications using Struts
Chapter 14. Develop Web applications using JSF and SDO
Chapter 15. Develop applications using EGL
Chapter 16. Develop Web applications using EJBs
Chapter 17. Develop J2EE application clients
Chapter 18. Develop Web services applications
Chapter 19. Develop portal applications
Part 3. Test and debug applications
Chapter 20. Servers and server configuration
Chapter 21. Test using JUnit
Chapter 22. Debug local and remote applications
Part 4. Deploy and profile applications
Chapter 23. Build applications with Ant
Chapter 24. Deploy enterprise applications
Chapter 25. Profile applications
Part 5. Team development
Chapter 26. ClearCase integration
Chapter 27. CVS integration
Appendix A. Product installation
Appendix B. Additional material
WebSphere MQ V6 Fundamentals
Chapter 1. Overview
Chapter 2. Concepts of message queuing
Chapter 3. Facilities for message queuing provided by WebSphere MQ
Chapter 4. Designing applications that access a WebSphere MQ infrastructure
Chapter 5. Understanding and configuring queue managers
Chapter 6. Technical introduction to message queuing
Chapter 7. Queue manager intercommunicat ion and client connections in WebSphere MQ
Chapter 8. Queue manager clusters
Chapter 9. Hands-on introduction to messaging with WebSphere MQ
Chapter 10. Hands-on guide to building WebSphere MQ infrastructure
Chapter 11. Securing a WebSphere MQ infrastructure
Chapter 12. Troubleshooting
Appendix A. Functionality new to WebSphere MQ V6.0
Appendix B. Quick reference
Migrating Applications from WebLogic, JBoss and Tomcat to WebSphere V6
Chapter 1. Introduction
Chapter 2. WebSphere overview
Chapter 3. Migration strategy and planning
Chapter 4. Installation and configuration
Chapter 5. Common migration issues
Chapter 6. Migrating from BEA WebLogic
Chapter 7. Migrating from JBoss
Chapter 8. Migrating from Tomcat
Appendix A. Development tips for portable applications
Appendix B. Additional material
Source Code for Redbooks
IBM WebSphere Developer Technical Journal
WebSphere : developerWorks
WAS 6.0 resources
WAS news
IBM - WebSphere MQ - Library
IBM - WMQ JMS exception messages
Understanding LDAP - Design and Implementation
Finally best for general articles/tutori als on Java
Transactions in J2EE
WebSphere Web Services Information Roadmap
General information
Concepts, technology, and specifications
Developing Web services
Working with the Web Services Gateway
Web services security
Building solutions using Web services
Using Web Services for Business Integration
Chapter 1. Web services technology and standards
Chapter 2. Sample application
Chapter 3. WebSphere InterChange Server as a Web services router
Chapter 4. WebSphere BI Message Broker as a Web services router
Chapter 5. WebSphere Enterprise as a Web services router
Chapter 6. Process Choreographer as a Web services router
Appendix A. Hardware and software configuration
Appendix B. Additional material
Programming J2EE APIs with WebSphere Advanced
Part 1. Introduction
Chapter 1. Our development conditions
Chapter 2. J2EE overview
Chapter 3. Products used within this book
Chapter 4. Introducing PiggyBank
Part 2. The EJB container
Chapter 5. Working with Enterprise JavaBeans
Chapter 6. Transactions and EJBs
Chapter 7. Messaging with JMS, WebSphere and MQSeries
Part 3. The Web container
Chapter 8. Servlets
Chapter 9. JavaServer Pages
Chapter 10. JSPs extended: custom tags
Part 4. Additional discussions
Chapter 11. Application clients and J2EE communications
Chapter 12. Deploying J2EE applications to WebSphere
Appendix A. Additional material
Patterns: Service-Oriente
Chapter 1. Patterns for e-business
Chapter 2. Service-oriente
Chapter 3. Service-oriente
Chapter 4. Service-oriente
Chapter 5. Technology options
Chapter 6. HTTP service bus
Chapter 7. JMS service bus
Chapter 8. Service directory
Chapter 9. Web service gateway
Chapter 10. e-business on demand and Service-oriente
Appendix A. Scenarios lab environment
Appendix B. Additional material
Self-Study Guide: WebSphere Studio Application Developer and Web Services
Part 1. Presentations
Unit 1. Workshop Introduction
Unit 2. Application Developer: Overview
Unit 3. Application Developer: Java Development
Unit 4. Application Developer: Relational Schema Center
Unit 5. Application Developer: XML Development
Unit 6. Application Developer: Web Development
Unit 7. Application Developer: EJB Development
Unit 8. Application Developer: Deployment to WebSphere
Unit 9. Application Developer: Profiling Tools
Unit 10. Application Developer: Team Development
Unit 11. Web Services Overview
Unit 12. Creating Web Services
Unit 13. Using Web Services
Unit 14. Web Services and the UDDI Explorer
Part 2. Exercises
Exercise 1. Java development
Exercise 2. Relational Schema Center
Exercise 3. XML development
Exercise 4. Web development
Exercise 5. EJB development
Exercise 6. Test and deploy using WebSphere AEs
Exercise 7. Profiling an application
Exercise 8. Create a Web Service
Exercise 9. Deploy and test a Web Service
Exercise 10. Using a Web service in a client application
Exercise 11. Web Service publishing in the UDDI registry
Part 3. Appendixes
Appendix A. Installation and configuration
Appendix B. Additional material
Patterns: SOA with an Enterprise Service Bus in WebSphere Application Server V6
Part 1. Patterns for e-business and SOA
Chapter 1. Introduction to Patterns for e-business
Chapter 2. SOA and the Enterprise Service Bus
Chapter 3. Application Integration and Extended Enterprise patterns
Chapter 4. Product descriptions and ESB capabilities
Chapter 5. SOA runtime patterns and Product mappings
Part 2. Business scenario and guidelines
Chapter 6. The business scenario that this book uses
Chapter 7. Technology options
Part 3. Scenario implementation
Chapter 8. SOA Direct Connection pattern
Chapter 9. Enterprise Service Bus pattern: router scenario
Chapter 10. Enterprise Service Bus pattern: broker scenario
Chapter 11. Exposed ESB Gateway pattern
Part 4. Appendixes
Appendix A. Additional material
Appendix B. Configuring the scenario environment
Connecting Enterprise Applications to WebSphere Enterprise Service Bus
Part 1. Background
Chapter 1. Connecting enterprise applications
Chapter 2. Service Component Architecture
Chapter 3. Connecting to the WebSphere Enterprise Service Bus
Chapter 4. Adapters
Part 2. Scenarios and patterns
Chapter 5. Business scenarios
Chapter 6. Connection patterns
Part 3. Working examples
Chapter 7. Historical integration using WebSphere MQ
Chapter 8. Custom CICS integration using WebSphere MQ
Chapter 9. Code-free CICS integration using WebSphere MQ
Chapter 10. Custom application integration using JMS
Chapter 11. Event-driven integration using a JDBC adapter
Chapter 12. Lightweight Web client integration using http
Chapter 13. Lightweight Web service integration using http
Chapter 14. Summary
Appendix A. Additional material
Appendix B. Source listings
Patterns: Implementing an SOA using an Enterprise Service Bus
Part 1. Patterns for e-business and SOA
Chapter 1. Introduction to Patterns for e-business
Chapter 2. e-business on demand and service-oriented architecture
Chapter 3. Web services and service-oriented architecture
Part 2. Enterprise Service Bus
Chapter 4. Enterprise Service Bus and SOA patterns
Chapter 5. ESB and SOA component implementations
Chapter 6. Endpoint enablement roadmap
Part 3. Scenario implementation
Chapter 7. The business scenario used in this book
Chapter 8. Enterprise Service Bus: Router variation
Chapter 9. Enterprise Service Bus: Broker variation
Chapter 10. Business Service Choreography
Chapter 11. Exposed ESB Gateway composite pattern
Appendix A. Additional material
Appendix B. Configuring the scenario lab environment
Patterns: SOA Design Using WebSphere Message Broker and WebSphere ESB
Chapter 1. Introduction
Part 1. Concepts, patterns, and products
Chapter 2. Introduction to SOA and ESB
Chapter 3. Product descriptions
Part 2. Product capabilities in relation to SOA and ESB
Chapter 4. ESB runtime patterns and product mappings
Chapter 5. WebSphere Enterprise Service Bus
Chapter 6. WebSphere Message Broker in SOA
Chapter 7. WebSphere DataPower appliances in SOA
Chapter 8. ESB design options
Part 3. Physical scenarios
Chapter 9. Scenario: using WebSphere ESB and WebSphere Message Broker in combination
Chapter 10. Scenario: DataPower in an SOA
Appendix A. Java node source code
Appendix B. Sample instructions
Appendix C. Additional material
WebSphere Version 6 Web Services Handbook Development and Deployment
Part 1. Web services concepts
Chapter 1. Web services introduction
Chapter 2. Web services standards
Chapter 3. Introduction to SOAP
Chapter 4. Introduction to WSDL
Chapter 5. JAX-RPC (JSR 101)
Chapter 6. Web Services for J2EE
Chapter 7. Introduction to UDDI
Chapter 8. Web Services Inspection Language
Chapter 9. Web services security
Chapter 10. Web services interoperabilit
Chapter 11. Web services architectures
Chapter 12. Best practices
Part 2. Implementing and using Web services
Chapter 13. IBM products for Web services
Chapter 14. Sample application: Weather forecast
Chapter 15. Development overview
Chapter 16. Develop Web services with Application Developer V6.0
Chapter 17. Test and monitor Web services
Chapter 18. Deploy and run Web services in WebSphere Application Server V6.0
Chapter 19. Command-line tools, Ant, and multiprotocol binding
Part 3. Advanced Web services techniques
Chapter 20. Web services interoperabilit
Chapter 21. Securing Web services
Chapter 22. Web services and the service integration bus
Chapter 23. Implementing a private UDDI registry
Chapter 24. Web services caching
Appendix A. Installation and setup
Appendix B. WS-Security configuration details: Mapping V5/V6, predefined properties, sample forms
Appendix C. Additional material
Experience J2EE! Using WebSphere Application Server V6.1
Part 1. Preliminary activities
Chapter 1. Introduction
Chapter 2. Install and configure software
Chapter 3. Configure the development environment
Chapter 4. Prepare the legacy application
Part 2. Core J2EE application
Chapter 5. Create the employee data access element
Chapter 6. Create the funds data access element
Chapter 7. Create the donate business logic element
Chapter 8. Create the employee facade business logic element
Chapter 9. Create the Web front end
Chapter 10. Create the application client
Chapter 11. Implement core security
Chapter 12. Alternative Import the core J2EE application
Part 3. Web services
Chapter 13. Create the Web service
Chapter 14. Implement security for the Web service
Part 4. Messaging
Chapter 15. Create the message-driven bean
Chapter 16. Add publication of results
Chapter 17. Implement security for messaging
Chapter 18. What next?
Appendix A. Additional material
Web Services Feature Pack for WebSphere Application Server V6.1
Part 1. Introduction
Chapter 1. What is in the feature pack
Chapter 2. History and roadmap
Part 2. Benefits of the feature pack
Chapter 3. Business scenarios
Chapter 4. Facets and patterns
Chapter 5. Technical advantages
Part 3. Using the feature pack
Chapter 6. Installation
Chapter 7. JAX-WS programming model
Chapter 8. Policy sets
Chapter 9. Secure conversation
Chapter 10. Reliable messaging
Chapter 11. Interoperabilit
Appendix A. Sample code
Appendix B. Additional material
Web Services Handbook for WebSphere Application Server 6.1
Part 1. Web services concepts
Chapter 1. Web services introduction
Chapter 2. Web services standards
Chapter 3. Introduction to SOAP
Chapter 4. Introduction to WSDL
Chapter 5. JAX-RPC (JSR 101)
Chapter 6. Web Services for J2EE
Chapter 7. Introduction to UDDI
Chapter 8. Web services security
Chapter 9. Web services interoperabilit
Chapter 10. Web services architectures
Chapter 11. Best practices
Part 2. Implementing and using Web services
Chapter 12. IBM products for Web services
Chapter 13. Sample application: Weather forecast
Chapter 14. Development overview
Chapter 15. Develop Web services with Application Server Toolkit 6.1
Chapter 16. Test and monitor Web services
Chapter 17. Deploy and run Web services in WebSphere Application Server 6.1
Chapter 18. Command-line tools, Ant, and multiprotocol binding
Part 3. Advanced Web services techniques
Chapter 19. WS-Addressing and WS-Resource
Chapter 20. Web services transactions using WS-Coordination
Chapter 21. Web services and the service integration bus
Chapter 22. WS-Notification
Chapter 23. Web services interoperabilit
Chapter 24. Implementing a private UDDI registry
Chapter 25. Securing Web services
Chapter 26. Web services caching
Appendix A. Installation and setup
Appendix B. Additional material
WebSphere MQ Version 6 and Web Services
Part 1. Overview
Chapter 1. Introduction
Chapter 2. Objectives
Chapter 3. Technologies
Part 2. Web Services and security considerations
Chapter 4. WebSphere Services with WebSphere MQ
Chapter 5. SOAP/WebSphere MQ implementation
Chapter 6. Security
Part 3. Implementing synchronous Web Services
Chapter 7. Environment setup
Chapter 8. Axis Web Service
Chapter 9. Axis client
Chapter 10. .NET Web Service
Chapter 11. .NET client
Chapter 12. WebSphere Application Server Web Service
Chapter 13. WebSphere Application Server client
Part 4. Asynchrony and transactionalit
Chapter 14. Long-term asynchronous functionality (MA0V)
Chapter 15. Implementing long-term asynchronousWeb
Chapter 16. Transactional functionality (MA0V)
Chapter 17. Implementing transactionalit
Part 5. Web Services and WebSphere MQ clustering
Chapter 18. Using WebSphere MQ clustering with Web Services
Appendix A. WebSphere MQ using .NET classes
Appendix B. WebSphere MQ using Java classes
Appendix C. Deployment utility quick reference
Appendix D. Additional material
Connecting Enterprise Applications to WebSphere Enterprise Service Bus
Part 1. Background
Chapter 1. Connecting enterprise applications
Chapter 2. Service Component Architecture
Chapter 3. Connecting to the WebSphere Enterprise Service Bus
Chapter 4. Adapters
Part 2. Scenarios and patterns
Chapter 5. Business scenarios
Chapter 6. Connection patterns
Part 3. Working examples
Chapter 7. Historical integration using WebSphere MQ
Chapter 8. Custom CICS integration using WebSphere MQ
Chapter 9. Code-free CICS integration using WebSphere MQ
Chapter 10. Custom application integration using JMS
Chapter 11. Event-driven integration using a JDBC adapter
Chapter 12. Lightweight Web client integration using http
Chapter 13. Lightweight Web service integration using http
Chapter 14. Summary
Appendix A. Additional material
Appendix B. Source listings
Enabling SOA Using WebSphere Messaging
Chapter 1. Introduction
Chapter 2. Product selection
Chapter 3. Runtime topology selection
Chapter 4. Application design
Chapter 5. Point-to-point runtime configuration
Chapter 6. Integration scenarios with WebSphere ESB
Chapter 7. Integration scenarios with WebSphere Message Broker
Appendix A. Sample files
MQSeries Programming Patterns
Part 1. Introduction
Chapter 1. Introduction and patterns
Chapter 2. Messaging and the APIs
Part 2. The APIs
Chapter 3. Programming with MQI
Chapter 4. Programming with AMI
Chapter 5. Programming with C++
Chapter 6. Programming with ActiveX
Chapter 7. Programming with Java
Chapter 8. Programming with JMS
MQSeries Workflow for Windows NT for Beginners
Chapter 1. Introduction
Chapter 2. Installation and configuration
Chapter 3. Using MQSeries Workflow - a tutorial
Chapter 4. Using MQSeries Workflow - next steps
Chapter 5. Programming using DB2 and Workflow APIs
Appendix A. OrderFulfillmen
Appendix B. StartOrder.java
MQSeries Security: Example of Using a Channel Security Exit, Encryption and Decryption
WebSphere Application Server V6: Default Messaging Provider Problem Determination
WebSphere Application Server V6.1 Web Services Problem Determination
Introduction
Problems that occur during development
Problems deploying Web services applications
Problems that occur during runtime
Collecting diagnostic data
The next step
WebSphere Application Server V6.1: JMS Problem Determination
Chapter 1. Introduction to JMS problem determination
Chapter 2. Messaging engine problem determination
Chapter 3. Message store problem determination
Chapter 4. Message store with data store persistence
Chapter 5. File store problem determination
Chapter 6. JMS application problem determination
Chapter 7. Messaging in a multiple messaging engine environment
Chapter 8. Clustering problem determination
Chapter 9. Message-driven beans problem determination
Chapter 10. WebSphere MQ and MDBs
Chapter 11. WebSphere MQ Server problem determination
Chapter 12. WebSphere MQ configuration
Chapter 13. WebSphere MQ link problem determination
Chapter 14. JMS application with WebSphere MQ problem determination
Chapter 15. Foreign bus problem determination
Chapter 16. Mediation problem determination
Chapter 17. Default messaging provider security
Chapter 18. The next step
WebSphere Application Server V6.1: Classloader Problem Determination
Introduction to class loaders
Problem determination for class loader exceptions
ClassCastExcept
ClassNotFoundEx
NoClassDefFound
NoSuchMethodErr
UnsatisfiedLink
VerifyError
Configuring shared libraries
Using custom JAR files for your application
Collecting diagnostic data
The next step
WebSphere Application Server V6.1: Technical Overview
Not available.
WebSphere Application Server V6.1: System Management and Configuration
Part 1. The basics
Chapter 1. WebSphere Application Server
Chapter 2. System management: A technical overview
Chapter 3. Getting started with profiles
Chapter 4. Administration basics
Chapter 5. Administration with scripting
Chapter 6. Configuring WebSphere resources
Chapter 7. Managing Web servers
Part 2. Messaging with WebSphere
Chapter 8. Asynchronous messaging
Chapter 9. Default messaging provider
Part 3. Working with applications
Chapter 10. Session management
Chapter 11. WebSphere naming implementation
Chapter 12. Understanding class loaders
Chapter 13. Packaging applications
Chapter 14. Deploying applications
WebSphere Security Fundamentals
Chapter 1. Security fundamentals
Chapter 2. Supporting security components for WebSphere
Chapter 3. Security fundamentals for J2SE, J2EE, and WebSphere
IBM WebSphere Application Server V6.1 Security Handbook
Part 1. Application server security
Chapter 1. Introduction
Chapter 2. Configuring the user registry
Chapter 3. Administrative security
Chapter 4. SSL administration
Chapter 5. JAAS for authentication in WebSphere Application Server
Chapter 6. Application security
Chapter 7. Securing a Web application
Chapter 8. Securing an EJB application
Chapter 9. Client security
Chapter 10. Securing the service integration bus
Part 2. Extending security beyond the Application Server
Chapter 11. Security attribute propagation
Chapter 12. Securing a WebSphere application using Tivoli Access Manager
Chapter 13. Trust Association Interceptors and third party software integration
Chapter 14. Externalizing authorization with JACC
Chapter 15. Web services security
Chapter 16. Securing access to WebSphere MQ
Chapter 17. J2EE Connector security
Chapter 18. Securing the database connection
Part 3. Development environment
Chapter 19. Development environment security
Appendix A. Additional configurations
Appendix B. Additional material
Security in WebSphere Application Server V6.1 and J2EE 1.4 on z/OS
Chapter 1. Introduction
Chapter 2. WebSphere security design
Chapter 3. Web container security
Chapter 4. Application security
Chapter 5. Web services security introduction
Chapter 6. Web services message layer security
Chapter 7. Secure Sockets Layer (SSL)
Chapter 8. Web services transport security
Chapter 9. Security attribute propagation and CSIv2
Chapter 10. User registries
Chapter 11. SPNEGO and Windows single sign-on
Chapter 12. Operating system security
Chapter 13. WAS administrative security
Appendix A. Additional material
Rational Application Developer V7 Programming Guide
Part 1. Introduction to Rational Application Developer
Chapter 1. Introduction
Chapter 2. Programming technologies
Chapter 3. Workbench setup and preferences
Chapter 4. Perspectives, views, and editors
Chapter 5. Projects
Part 2. Develop applications
Chapter 6. RUP and UML
Chapter 7. Develop Java applications
Chapter 8. Accelerate development using patterns
Chapter 9. Develop Database Applications
Chapter 10. Develop GUI applications
Chapter 11. Develop XML applications
Chapter 12. Develop Web applications using JSPs and servlets
Chapter 13. Develop Web applications using Struts
Chapter 14. Develop Web applications using JSF and SDO
Chapter 15. Develop applications using EGL
Chapter 16. Develop Web applications using EJBs
Chapter 17. Develop J2EE application clients
Chapter 18. Develop Web services applications
Chapter 19. Develop portal applications
Part 3. Test and debug applications
Chapter 20. Servers and server configuration
Chapter 21. Test using JUnit
Chapter 22. Debug local and remote applications
Part 4. Deploy and profile applications
Chapter 23. Build applications with Ant
Chapter 24. Deploy enterprise applications
Chapter 25. Profile applications
Part 5. Team development
Chapter 26. ClearCase integration
Chapter 27. CVS integration
Appendix A. Product installation
Appendix B. Additional material
WebSphere MQ V6 Fundamentals
Chapter 1. Overview
Chapter 2. Concepts of message queuing
Chapter 3. Facilities for message queuing provided by WebSphere MQ
Chapter 4. Designing applications that access a WebSphere MQ infrastructure
Chapter 5. Understanding and configuring queue managers
Chapter 6. Technical introduction to message queuing
Chapter 7. Queue manager intercommunicat
Chapter 8. Queue manager clusters
Chapter 9. Hands-on introduction to messaging with WebSphere MQ
Chapter 10. Hands-on guide to building WebSphere MQ infrastructure
Chapter 11. Securing a WebSphere MQ infrastructure
Chapter 12. Troubleshooting
Appendix A. Functionality new to WebSphere MQ V6.0
Appendix B. Quick reference
Migrating Applications from WebLogic, JBoss and Tomcat to WebSphere V6
Chapter 1. Introduction
Chapter 2. WebSphere overview
Chapter 3. Migration strategy and planning
Chapter 4. Installation and configuration
Chapter 5. Common migration issues
Chapter 6. Migrating from BEA WebLogic
Chapter 7. Migrating from JBoss
Chapter 8. Migrating from Tomcat
Appendix A. Development tips for portable applications
Appendix B. Additional material
Source Code for Redbooks
IBM WebSphere Developer Technical Journal
WebSphere : developerWorks
WAS 6.0 resources
WAS news
IBM - WebSphere MQ - Library
IBM - WMQ JMS exception messages
Understanding LDAP - Design and Implementation
Finally best for general articles/tutori
Tuesday, October 21, 2008
How to generate stacktrace
Requesting stackTrace on linux
kill -"quitsignal" "pid"
How to find the signal?
Execute kill -l to get a list of signals and their numbers. See which is the one for QUIT, usually it would be QUIT OR SIGQUIT and number would be 3 based on your OS. Then send quit signal as below:
kill -3 "pid" OR kill -s SIGQQUIT "pid"
The dump file would be created in the corresponding profile directory or the place where it is configured. If you have a open console where process is running, then we can generate the dump by pressing\. On windows we need to press
Getting stackTrace on JBOSS by using JMX console. Select the MBean 'type=ServerInf o' under jboss.system. Invoke the operation listThreadDump( ) to get the required output.
This link explains clearly how to read stack traces.
kill -"quitsignal" "pid
How to find the signal?
Execute kill -l to get a list of signals and their numbers. See which is the one for QUIT, usually it would be QUIT OR SIGQUIT and number would be 3 based on your OS. Then send quit signal as below:
kill -
The dump file would be created in the corresponding profile directory or the place where it is configured. If you have a open console where process is running, then we can generate the dump by pressing
Getting stackTrace on JBOSS by using JMX console. Select the MBean 'type=ServerInf
This link explains clearly how to read stack traces.
Tuesday, October 14, 2008
XML validation using XSD
I was using JAXB for reading one configuration file and before unmarshall, I want to validate the document. To do this we need to know two things:
- How to link xml document with schema
- How to configure SAX/DOM parser to use the schema and validate
Friday, October 3, 2008
Creating XSD from XML
Recently we had a requirement to build a data model at the back-end for a web front-end, which is based on an xml file. Once decided to use jaxb, we realised we didn't have the schema definition but only have xml file. So started my search for creating xsd from xml. I found couple of on-line links for xsd creation and other applications supporting this feature.
On-line links
http://www.flame-ware.com/xml2xsd/
http://www.xmlforasp.net/codeSection.aspx?csID=79
http://www.hitsw.com/xml_utilites/
Others
IBM RAD can generate xsd from xml, you need to add xml file as part of some project.
Microsoft also provides a tool xsd.exe, but I guess you need .NET framework for this to work.
Another open-source tool trang.
On-line links
http://www.flame-ware.com/xml2xsd/
http://www.xmlforasp.net/codeSection.aspx?csID=79
http://www.hitsw.com/xml_utilites/
Others
IBM RAD can generate xsd from xml, you need to add xml file as part of some project.
Microsoft also provides a tool xsd.exe, but I guess you need .NET framework for this to work.
Another open-source tool trang.
Monday, September 22, 2008
Reading xls files from Java using apache POI
Ever wondered reading/writing xls, doc files through Java. Its now (probably since long time) possible using apache POI. I was specifically looking at reading xls files in order to receive some messages for our application.
I know couple of alternatives, but after finding POI I ignored the rest. The library for handling excel formats is called HSSF (Horrible SpreadSheet Format). I wonder why something is ever looked at as bad, maybe it is just the case that we are not able to see the hidden (rather other-side) benefits/workings?
Anyways, HSSF provides two models for reading xls files, usermodel and eventmodel. Usermodel is the old one where one can visualize the workbook as number of sheets, each sheet as number of rows and each row as number of columns. As one can guess memory usage would be more in this model.
Eventmodel on the other hand is like SAX parsing, where in one would get notified of various events as parsing/reading of the file progresses. As per the developers comments this is more efficient in terms of memory consumption, processing speed and provides finer control of reading and thus better handling of data within xls files.
To start with I just went ahead with usermodel and successfully converted xls to an xml file. My sample xls file contains a number of contact details, first row contains headers and remaining rows contain the actual data. Below is the sample code for converting this data into xml.
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class XLS2XML
{
HSSFWorkbook workbook = null;
HSSFSheet sheet = null;
ArrayList headers = new ArrayList();
public XLS2XML(InputStream in) throws Exception
{
workbook = new HSSFWorkbook(in);
sheet = workbook.getSheetAt(0);
}
public String xmlExtractor() throws Exception
{
StringBuffer ret = new StringBuffer();
Iterator rows = sheet.rowIterator();
initialiseHeader((HSSFRow)rows.next());
ret.append("<" + workbook.getSheetName(0) + ">");
while(rows.hasNext())
{
HSSFRow row = (HSSFRow)rows.next();
ret.append(rowExtractor(row));
}
ret.append("");
return ret.toString();
}
private void initialiseHeader(HSSFRow row)
{
short minColIdx = row.getFirstCellNum();
short maxColIdx = row.getLastCellNum();
for(short colIdx = minColIdx; colIdx < maxColIdx; colIdx++)
{
HSSFCell cell = row.getCell(colIdx);
if(cell == null)
{
continue;
}
headers.add(cell.getRichStringCellValue().getString());
}
}
private String rowExtractor(HSSFRow row)
{
StringBuffer ret = new StringBuffer();
short minColIdx = row.getFirstCellNum();
short maxColIdx = row.getLastCellNum();
ret.append("");
for(short colIdx = minColIdx; colIdx < maxColIdx; colIdx++)
{
HSSFCell cell = row.getCell(colIdx);
if(cell == null)
{
continue;
}
ret.append(getPrefix(colIdx));
ret.append(getCellValue(cell));
ret.append(getSuffix(colIdx));
}
ret.append("");
return ret.toString();
}
private String getPrefix(short i)
{
return "<" + headers.get(i).toString() + ">";
}
private String getSuffix(short i)
{
return "";
}
private String getCellValue(HSSFCell cell)
{
String ret = null;
switch(cell.getCellType())
{
case HSSFCell.CELL_TYPE_NUMERIC:
ret = Double.toString(cell.getNumericCellValue());
break;
case HSSFCell.CELL_TYPE_STRING:
ret = cell.getRichStringCellValue().getString();
break;
default:
ret = "";
}
return ret;
}
}
I know couple of alternatives, but after finding POI I ignored the rest. The library for handling excel formats is called HSSF (Horrible SpreadSheet Format). I wonder why something is ever looked at as bad, maybe it is just the case that we are not able to see the hidden (rather other-side) benefits/workings?
Anyways, HSSF provides two models for reading xls files, usermodel and eventmodel. Usermodel is the old one where one can visualize the workbook as number of sheets, each sheet as number of rows and each row as number of columns. As one can guess memory usage would be more in this model.
Eventmodel on the other hand is like SAX parsing, where in one would get notified of various events as parsing/reading of the file progresses. As per the developers comments this is more efficient in terms of memory consumption, processing speed and provides finer control of reading and thus better handling of data within xls files.
To start with I just went ahead with usermodel and successfully converted xls to an xml file. My sample xls file contains a number of contact details, first row contains headers and remaining rows contain the actual data. Below is the sample code for converting this data into xml.
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class XLS2XML
{
HSSFWorkbook workbook = null;
HSSFSheet sheet = null;
ArrayList headers = new ArrayList();
public XLS2XML(InputStream in) throws Exception
{
workbook = new HSSFWorkbook(in);
sheet = workbook.getSheetAt(0);
}
public String xmlExtractor() throws Exception
{
StringBuffer ret = new StringBuffer();
Iterator rows = sheet.rowIterator();
initialiseHeader((HSSFRow)rows.next());
ret.append("<" + workbook.getSheetName(0) + ">");
while(rows.hasNext())
{
HSSFRow row = (HSSFRow)rows.next();
ret.append(rowExtractor(row));
}
ret.append("");
return ret.toString();
}
private void initialiseHeader(HSSFRow row)
{
short minColIdx = row.getFirstCellNum();
short maxColIdx = row.getLastCellNum();
for(short colIdx = minColIdx; colIdx < maxColIdx; colIdx++)
{
HSSFCell cell = row.getCell(colIdx);
if(cell == null)
{
continue;
}
headers.add(cell.getRichStringCellValue().getString());
}
}
private String rowExtractor(HSSFRow row)
{
StringBuffer ret = new StringBuffer();
short minColIdx = row.getFirstCellNum();
short maxColIdx = row.getLastCellNum();
ret.append("
for(short colIdx = minColIdx; colIdx < maxColIdx; colIdx++)
{
HSSFCell cell = row.getCell(colIdx);
if(cell == null)
{
continue;
}
ret.append(getPrefix(colIdx));
ret.append(getCellValue(cell));
ret.append(getSuffix(colIdx));
}
ret.append("");
return ret.toString();
}
private String getPrefix(short i)
{
return "<" + headers.get(i).toString() + ">";
}
private String getSuffix(short i)
{
return "";
}
private String getCellValue(HSSFCell cell)
{
String ret = null;
switch(cell.getCellType())
{
case HSSFCell.CELL_TYPE_NUMERIC:
ret = Double.toString(cell.getNumericCellValue());
break;
case HSSFCell.CELL_TYPE_STRING:
ret = cell.getRichStringCellValue().getString();
break;
default:
ret = "";
}
return ret;
}
}
Saturday, September 20, 2008
Set SP params by name - new feature added in oracle 10g jdbc driver
Everyone would try not to hard-code the signature of stored procedure (SP) in all java applications requiring database interaction through SPs. One of many ways could be having the signature defined as an xml config and application can intelligently manage any changes to xml config without any code changes. Most of the complexity in doing so would result from managing the sequence numbers of parameters.
From Oracle10g onwards this shall not be the case anymore as 10g jdbc drivers support SP invocation by param names along with sequence numbers. Unfortunately this is not the case with Sybase yet (have tested with jconn3.jar). Below is the sample code I have used for testing this feature with Oracle driver ver.10.2.0.1.0
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Types;
public class SPTester
{
private static CallableStatement setParamsByName(CallableStatement sp) throws Exception
{
sp.registerOutParameter("param1", Types.NUMERIC);
sp.registerOutParameter("param2", Types.VARCHAR);
sp.registerOutParameter("param3", Types.VARCHAR);
sp.registerOutParameter("param4", Types.VARCHAR);
sp.registerOutParameter("param5", Types.VARCHAR);
sp.setString("param5", "12345");
return sp;
}
private static CallableStatement setParamsBySeq(CallableStatement sp) throws Exception
{
sp.registerOutParameter(1, Types.NUMERIC);
sp.registerOutParameter(2, Types.VARCHAR);
sp.registerOutParameter(3, Types.VARCHAR);
sp.registerOutParameter(5, Types.VARCHAR);
sp.registerOutParameter(6, Types.VARCHAR);
sp.setString(4, "12345");
return sp;
}
private static void getParamsByName(CallableStatement sp) throws Exception
{
System.out.println("param1: " + sp.getString("param1"));
System.out.println("param2: " + sp.getString("param2"));
System.out.println("param3: " + sp.getString("param3"));
System.out.println("param4: " + sp.getString("param4"));
System.out.println("param5: " + sp.getString("param5"));
}
private static void getParamsBySeq(CallableStatement sp) throws Exception
{
System.out.println("param1: " + sp.getString(1));
System.out.println("param2: " + sp.getString(2));
System.out.println("param3: " + sp.getString(3));
System.out.println("param4: " + sp.getString(5));
System.out.println("param5: " + sp.getString(6));
}
public static void main(String[] args) throws Exception
{
Connection con = null;
CallableStatement sp = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection("jdbc:oracle:thin:@<server>:<port>:<sid>", "usr", "pass");
sp = con.prepareCall("{call <sp_name> (?, ?, ?, ?, ?, ?)}");
int i = 10;
if(i == 0) // by sequence
{
setParamsBySeq(sp);
sp.execute();
getParamsBySeq(sp);
}
else
{
setParamsByName(sp);
sp.execute();
getParamsByName(sp);
}
}
catch(Exception e)
{
throw e;
}
finally
{
try
{
if(sp != null)
{
sp.close();
}
if(con != null)
{
con.close();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
}
From Oracle10g onwards this shall not be the case anymore as 10g jdbc drivers support SP invocation by param names along with sequence numbers. Unfortunately this is not the case with Sybase yet (have tested with jconn3.jar). Below is the sample code I have used for testing this feature with Oracle driver ver.10.2.0.1.0
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Types;
public class SPTester
{
private static CallableStatement setParamsByName(CallableStatement sp) throws Exception
{
sp.registerOutParameter("param1", Types.NUMERIC);
sp.registerOutParameter("param2", Types.VARCHAR);
sp.registerOutParameter("param3", Types.VARCHAR);
sp.registerOutParameter("param4", Types.VARCHAR);
sp.registerOutParameter("param5", Types.VARCHAR);
sp.setString("param5", "12345");
return sp;
}
private static CallableStatement setParamsBySeq(CallableStatement sp) throws Exception
{
sp.registerOutParameter(1, Types.NUMERIC);
sp.registerOutParameter(2, Types.VARCHAR);
sp.registerOutParameter(3, Types.VARCHAR);
sp.registerOutParameter(5, Types.VARCHAR);
sp.registerOutParameter(6, Types.VARCHAR);
sp.setString(4, "12345");
return sp;
}
private static void getParamsByName(CallableStatement sp) throws Exception
{
System.out.println("param1: " + sp.getString("param1"));
System.out.println("param2: " + sp.getString("param2"));
System.out.println("param3: " + sp.getString("param3"));
System.out.println("param4: " + sp.getString("param4"));
System.out.println("param5: " + sp.getString("param5"));
}
private static void getParamsBySeq(CallableStatement sp) throws Exception
{
System.out.println("param1: " + sp.getString(1));
System.out.println("param2: " + sp.getString(2));
System.out.println("param3: " + sp.getString(3));
System.out.println("param4: " + sp.getString(5));
System.out.println("param5: " + sp.getString(6));
}
public static void main(String[] args) throws Exception
{
Connection con = null;
CallableStatement sp = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con = DriverManager.getConnection("jdbc:oracle:thin:@<server>:<port>:<sid>", "usr", "pass");
sp = con.prepareCall("{call <sp_name> (?, ?, ?, ?, ?, ?)}");
int i = 10;
if(i == 0) // by sequence
{
setParamsBySeq(sp);
sp.execute();
getParamsBySeq(sp);
}
else
{
setParamsByName(sp);
sp.execute();
getParamsByName(sp);
}
}
catch(Exception e)
{
throw e;
}
finally
{
try
{
if(sp != null)
{
sp.close();
}
if(con != null)
{
con.close();
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
}
Subscribe to:
Posts (Atom)