Use Case: Connect to external datasource using CQ
Solution:
1) My SQL
Step 1: Create OSGI version of mysql Jar file
If you are having trouble creating osgi version of mysql jar file, You can download it from here
2) Teradata
You can also download OSGI version of teradata jar file from here
Note: If You want to call instance of your Connection from Java class (Not from service) You can do something like this,
Solution:
1) My SQL
Step 1: Create OSGI version of mysql Jar file
- Download MySQL JDBC Driver From http://dev.mysql.com/downloads/connector/j
- Open eclipse and select file -> New -> Other -> Plugin development -> Plug-in from existing Jar Archive
- Click next and then select add external. Select jar file you downloaded above and select next
- Give Project Name -> Select Location -> Make sure that Analyze Library Content is checked -> In Target Platform select an OSGI framework -> from drop down select standard -> Check unzip jar file and update reference -> click finish
- An Plugin Development prospective will open
- Click on export tab and make sure that all dependencies are exported (If they are not there, Click on add then select all)
- Click on Dependencies and make sure that Imported packages are there. If it is not there click on MENIFEST.MF tab and then add following import statement
- Once all import and export statement is added your MENIFEST.MF will have following data
- Then right click on your project and then select export
- Select Deployable Deployable plug-in and fragments
- Click Next and select your plug-in
- From Directory section select location where you want to upload.
- Click finish. This will store OSGI jar in to location you selected.
- Once you have MySQL Osgi bundle. Install that bundle either using felix console or adding it through deployment process
- If you are getting error saying javax.Naming not getting resolved then you have to add following line in sling.properties under crx-quickstart folder
- Once bundle is up is running, You need to go to felix osgi config. Search For JDBC connection pool and then click '+'
- Fill all the information about your datasource
- Go to your application logic and test your code
If you are having trouble creating osgi version of mysql jar file, You can download it from here
2) Teradata
- All the steps for Teradata will remain same except you need to create teradata OSGI bundle using Teradata JDBC connector.
- First Download teradatajdbc connector from here https://code.google.com/p/kyunra-java/downloads/detail?name=terajdbc4.jar
- Then Download tdconfig jar from here https://code.google.com/p/kyunra-java/downloads/detail?name=tdgssconfig.jar
- Follow above steps to create osgi version of jar file (Everything will remain same except this time you need to select two jar file for creating osgi version of it)
- Your Final MENIFEST.MF will look like this
- Upload final jar file in CQ, make sure that it is active
- Open OSGI config to create config for teradata connection pool
- You can then test it using same code (Just use teradata data source)
You can also download OSGI version of teradata jar file from here
Note: If You want to call instance of your Connection from Java class (Not from service) You can do something like this,
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
Delete
ReplyDeleteGreat blog! Your explanation style is too good, it is very impressed to me. I want more unique posts and Keeping the good work...
Oracle DBA Training in Chennai
Oracle DBA Course in Chennai
Unix Training in Chennai
Oracle Training in Chennai
Pega Training in Chennai
Primavera Training in Chennai
Excel Training in Chennai
Corporate Training in Chennai
Tableau Training in Chennai
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, I would like to suggest your blog in my dude circle, so keep on updates.
ReplyDeleteSoftware Testing Training in Chennai
Software Testing Course in Chennai
RPA Training in Chennai
SEO Training in Chennai
Hadoop Training in Chennai
Digital Marketing Course in Chennai
Software Testing Training in OMR
Thanks for sharing informative article… learning driving from experienced instructors help you to learn driving very fast… Learn Melbourne Driving Lessons from experts at Sprint driving School. International driving license
ReplyDeleteExcellent idea! Kind sharing this blog. I am sure that reading your blog leaves the people with some good learning experience. Great job.
ReplyDeleteIELTS Coaching in Anna Nagar
IELTS Coaching in Chennai Anna Nagar
IELTS Coaching in Adyar
IELTS Coaching in Porur
IELTS Coaching in Mumbai
Best English Speaking Classes in Mumbai
Spoken English Classes in Chennai
IELTS Coaching Centre in Chennai
This is an interesting blog that you have posted,Good job.
ReplyDeleteHtml5 Training in Chennai
DOT NET Training in Chennai
c# training in chennai
dot net classes in chennai
mvc training in chennai
Best DOT NET Training institute in Chennai
QTP Training in Chennai
LoadRunner Training in Chennai
Excellent Blog. I really want to admire the quality of this post. I like the way of your presentation of ideas, views and valuable content. No doubt you are doing great work. I’ll be waiting for your next post. Thanks .Keep it up! Kindly visit us @Luxury Boxes
ReplyDeletePremium Packaging
Luxury Candles Box
Earphone Packaging Box
Wireless Headphone Box
Innovative Packaging Boxes
Wedding gift box
Leather Bag Packaging Box
Cosmetics Packaging Box
Luxury Chocolate Boxes
Such an amazing blog with new updates. I love to learn more about this topic. Waiting for more like this.
ReplyDeleteMicrosoft Dynamics crm Training in Chennai
Microsoft Dynamics Training in Chennai
Microsoft Dynamics crm Training institutes in Chennai
Salesforce Training in Chennai
AngularJS Training in Chennai
ccna course in Chennai
Microsoft Dynamics crm Training in Velachery
Microsoft Dynamics crm Training in T Nagar
Microsoft Dynamics crm Training in OMR
Thank you for sharing this blog post, it is very informative and helpful for me. building and pest inspections Melbourne.
ReplyDeleteGreat information… Domestic oven detailers are premium over cleaners in Melbourne offering affordable oven & BBQ cleaning by trained professionals.
ReplyDelete