CouchDB Java client - java

This wiki page, http://wiki.apache.org/couchdb/Getting_started_with_Java, lists several CouchDB Java clients. I wonder if any of the clients mentioned is significantly more dominant/popular/better/supported than the others.

I think Ektorp is pretty much the clear leader at the mo. I've certainly been very happy with it, and I've never seen anybody using anything else.
In addition, as a quick metric, Ektorp is clearly far more actively maintained than any of the others: currently the last commit on Ektorp was 5 hours ago, vs 4 years for CouchDB4j, a little over 1 year for jcouchdb and 2 years for jRelax.

I tried CouchDB4j and it has only a few methods implemented. They are not so well documented and you might find the complete lack of code example implementations very frustrating as it happened to me.That is why I would not recommend it. To give you a feel about this API, I tried attaching a certain file to an already existing document from the database and it does not support this kind of process.
I will now give Ektorp a shot and will come back with an edit as I go along. Looking at the recent activity between these two it is a big difference: Ektorp has been last updated a month ago vs CouchDB4j having been updated 3 years ago at the moment when this comment was written. Hope this will help.
EDIT: Ektorp is definitely the way to go. It allows you to build your own kind of entry in the database, with as many and variate fields as you want. It also allows easy manipulation of attachments. For me, it did the trick.

Lightcouch seems to be most active nowadays. Ektorp is also still active, however.
Each has its own strengths, however, so I'd pick based on what level you want to be abstracted from CouchDB's HTTP API. Myself, I'd use Lightcouch.

Nowdays the most well supported Java Client for CouchDB should be the official one from IBM cloudant-java-sdk as it is their interest to maintain it. Here you can find it on Maven Repository.

Related

Import .csv to RTC using JAVA

I am working on IBM RTC and I need to import a .csv file to RTC using JAVA. Is there a way to do this? If yes, can someone help me with the same.
Parsing CSV data is something that you definitely do not want to implement yourself, there are plenty of libraries for that (see here).
RTC offers a wide range of APIs that can be used with, see:
rsjazz.wordpress.com or
jazz.net
In that sense: you can write Java code that reads CSV data, and RTC has a rich API that allows you push "content" into the system.
But a word of warning: I used that java API some years ago to manipulate information within our RTC instance. That was a very painful experience. I found the APIs to be badly documented and extremely hard to use. It took me several days to come to working code that would make just a few small updates to our stories/tasks.
Maybe things have improved since then, but be prepared for, as said ... a painful experience.
EDIT, regarding your comment on "other options":
Well, I dont see them: you want to push data you have in CSV into your RTC instance. So, if you still want to do that, you have to use that means that are available to you! And don't let my words discourage you. A) it was some time back when I did my programming with RTC, so maybe their APIs are better structured and more intuitive today. B) there is some documentation out there (for example here). And I think everybody can register at jazz.net; so when you have further, specific questions, you might find "better" answers there!
All I wanted to say was: I know that other products such as jenkins or sonarqube have great APIs; and you work with that, all nice, easy, fun. You get things working with RTC, too. Just the path there, maybe isnt that nice and easy.
My personal recommendation: start with the RTC part first. Meaning: just try to write a small programm that authenticates against the server; and then push some example data into the system. If that works nicely for you; then spend the time on pulling / transforming the real data that you have in mind!

What is the best way to try and understand a large Java Swing code base. [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Getting a clue at / debug a huge Java Swing App I’ve inherited
I joined a new project and have to understand the project's product. I am more familiar with daemon/standalone type applications but this time i have to get involved in Java GUI applications using Swing.
I have to familiarise myself with quite a large code base. I have been trying to do this for the last 3 days and find that i am struggling to get the "Big picture". The event driven model means that things can happen and are triggered from anywhere within the application.
At the moment i am still struggling to work out how the screen is built and put together. I can see the code but just struggling to follow because it is not the usual model that i am used to where you can just follow the references, calls etc.
Is there anything i can do to simplify/speed this learning process? I tend to understand things better when i see them in a diagrammatic form (class diagrams, sequence diagrams etc.). I am trying to see if i can try and find a tool that can reverse engineer the code to UML so that i can get a better understanding but because the code base is huge, the UML diagrams that will be generated will probably be unusable because of the number of classes involved.
Any advice would be appreciated.
Guess you are dealing with a legacy application and all the bagage that comes along with it.
So even if you got to generate a UML, I am willing to bet that it will not help you, since you will (most likely) find it to be a giant mess. Things that used to resemble a Design Pattern got messed up, code snippets copied and pasted from a to b to c, etc...
Your best bet (from my experience) is to follow the Programm logic in the debugger when you execute certain actions. At least thats what I found to be most useful when faced with similar senarios.
Get good IDE. I would recommend itellij idea for this task. It's not free, but it beats eclipse on every occasion
I agree with dngfng, a legacy application will come with its 'baggage'. Only 'time' and lot of discussion with existing developers will sort that.
Along with the other suggestions here, I d say just 'use' the product from the user point of view. Perform all the actions that are promised in the features till you get a hang of using the software. After that when you look at the codebase, it may get a little more intuitive.

to wrap or not to wrap an opensource framework? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Should you wrap 3rd party libraries that you adopt into your project?
I am using mail.jar, an opensource api to send mails in java.
I am wondering whether I should wrap its call to my own framework like this :
DedicatedFramework.sendMail(subject, body, recipientList);
this dedicatedFramework would then make the necessary calls to mail.jar.
The idea is that if tomorrow I replace mail.jar with a new version which deprecates/changes methods, then I reduce my coupling.
On the other hand, I add boiler code just to "hide" the framework.
What do you people do regarding this ?
Of course, it could be another framework than mail : picture managing, jdbcTemplate, GoogleCollections ...
No.
Do you know you'll have to use a different mail library tomorrow? Is it even likely? I doubt it. Wrappers just for the sake of "maybe one day" are the worst kind of YAGNI.
On the other hand, if your sendMail() method does something that would otherwise be repeated wherever you send a mail, then it's not a wrapper but a useful abstraction.
Wrap it. Making a bridge between what is available and how it's going to be used is going to save you 1) a lot of boilerplate code and 2) a lot of maintaining that code when something minor changes but you have to make the change in 20 places.
It's entirely possible there is more to this question that isn't being shown. What are our memory constraints? Can we support those extra classes being loaded? We have to identify what problems we would face by doing the wrap, just like any other problem.
However, if there isn't anything that says "We can't wrap because __" then I would recommend doing it.
I would wrap it. It's way easier to find and change code when it's all in one place.
In general, APIs are reasonably stable and classes/methods usually don't disappear, they get deprecated. In your particular case mail.jar is very stable so I wouldn't bother wrapping it.
My advice is to not waste your time writing an API on top of an API - it will cost you more time than it saves in the long run. I've used many libraries over the last decade and the only library I've ever had trouble with was one written by an in-house team - they refactored and changed package names and method names. That broke a lot of code. I've never experienced that with open source libraries.
Wrap
If the framework will be used generally all over your codebase
If it will be a part of project where relatively small number of developers know how to use the framework well
Don't Wrap
If it would be used at just a tiny portion of code that would be very unlikely to change
If the framework or api is realy common knowledge for developers

Framework or not?

yesterday i went to English Class and met new friend, he said with me about the worked he did (still now i have studied in school).
In his company, the customers have
many request for their project, if you
use framework but not understand all
component or like that, you would meet
problem with your source code and you
didn't fix it because it built by
another one. And Cusomters paid money
for you to developed their project,
you must completed it by yourself, and
if occur error you would to fix it.
But if you use framework you can fix
or not it's 50/50 percent for you.
I wonder about his said. Can you help me the best way me must choice? Framework or not?
We have many kinds customers and we must work with some technologies such as struts/ hibernate/Spring/ or so on...if not use framework the time we complete project so long but if use it i don't believe all component of it i can understand.
Thank you for your suggest!
• Should I use existing frameworks in my projects?
Yes, in general you should. The creators of the frameworks have put large amounts of work into them to make them good, and many other people use the frameworks, too. That means that the code is well-tested in practice. When you write your own code, it will be tested by just you and your team.
• What happens if there are bugs in the framework, how could I possibly fix them?
Good question, I don't know an answer right now. Most probably you would write some own code to work around the problem, like a small wrapper class.
• Do I have to understand the complete frameworks before I can use them?
No, you don't. Some frameworks are large and cover each and every aspect of software development. In most cases you only have to learn the things you really want to do, and some more. But not every detail.
• When I use a framework, is that cheating, since my customer wants me to develop software?
No, it isn't. Your customer doesn't really want you to do much work, he rather wants his projects to be done and finished. That means if you can do less work and profit from other's work, that's usually fine.
• We must work with third-party products like Structs/Hibernate/Spring, and if we are forced to implement them ourselves, the projects will take very long.
You really don't want to implement everything that Spring, Hibernate and Struts have already solved. So use these frameworks and be glad that someone else did the work. It's many man years that you will save.
There are many factors to consider:
Is the framework commercial? If so, does the framework have a responsive support team with the ability to provide demos, documentation, consulting, "work-abouts" and hot-fixes? Can you purchase the source code to make any tweaks you need? (Is it worth it to may extra to have access to the source and can you redistribute a modified copy?)
Is the framework "open source"? If so, does the framework have a responsive forum or mailing list that can provide answers to problems? Are there paid consultants or contractors? Is the documentation good? Is the framework popular and is it being maintained? Can you apply hot-fixes as needed?
How much "time" is required to learn the framework? Do special conventions need to be used? Does using the framework cause some lock-in that will be incompatible with future requirements?
Etc, etc.
This all leads to: Does using the framework ultimately make work more productive?
I think it depends on the size of the project. If you're working in a small project probably it's a nonsense to use a framework, because you're going to be less productive.
Instead if you're working in a big project the framework can help you a lot.
For example, in the case of Hibernate, if you're working in a project with three or four objects/tables, maybe it's a nonsense use it, because probably it's much easier to work with JDBC, and even the software will run much faster. But if you're in a project with docens of objects/tables working with JDBC can be a big headache, and hibernate helps you a lot.
The time you loose in the configuration of the framework is small compared to the big benefit in the simplification of the development.
According to the possible bugs in the framework, is important to use a framework with a good support and a good community which can help you to solve your problems.
Also if you use an open source framework you can try to solve the bug, add a new feature or modify an existing one to match with your project needs.

database and java

i am a student. i have to do the individual project about a system. the system must be done using the console not the web base. so i`m using netbeans version 6.9 and mysql version 5.2. my problem is i do not know how to connect them.
hopefully, you all can help me...
thanks a lot...
Use JDBC if you want to learn how things work. Most of the ORM tools are built on top of it.
This article describes how to use Java JDBC to connect to MySQL and perform SQL queries, database inserts and deletes.
The real issue seems to be the vocabulary you have used.
What you are trying to do is: "Connect to the SQL database through Netbeans."
Here's a tutorial:
http://netbeans.org/kb/docs/ide/mysql.html
Voice of experience:
Always check the developer's homepage for tutorials and manuals. It's surprising to find that most seemingly original questions have been comprehensively answered, or partially (yet sufficiently) answered. Conversely, there's no surprise in finding that the technical support community exacerbates peoples problems with their generally hideous intolerance of people who do not take this step for some reason or another. It's likely that someone who seems to have not read the manual, cover-to-cover, will be verbally abused. The assumption is: "all technically minded people should love reading manuals". The truth is: "reading manuals isn't fun until about year 7". Of course, there are rare exceptions to the cultural/social problem we've got. ;) I think some people enjoy the manuals straight away, too.

Categories

Resources