Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Mandar Khire

Ranch Hand
+ Follow
since Sep 11, 2007
Mandar likes ...
Android Java Linux
Pune, Maharashtra,India
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mandar Khire


I wrote very basic Java program (Java+xml + Hibernate API) for communicate with Mysql database & it works well in computer.
Now I am searching solution to how to write Android App which Communicate with same database.
But I dont want to use PHP or restful methods. Same way as I used for computer program.

Questions are
1. Is it possible?
2. If not then why not?
3. why PHP & Restful methods are better than this old method?

I refereed [url=]How to connect Android with MySQL using Mysql JDBC driver
But not successful for Android 7.1.1.
Need Guidance.
2 weeks ago
1. Generate Truth table for n Values. For Example n = 27.
2. Try to find out exact number of Possibilities. (Show complete Value.)
3. Try to find out Exact time required to print truth table, before print truth table.

For 1st requirement , I used Generating truth tables in Java for study purpose.
When I try size 27 then it takes very long time, even it make 100% utilization of CPU.

& For 2nd requirement I used Write a program to calculate pow(x,n).

So My program as follows:-

Question is:-
1. I cant show exact value of 27 raised to 27.  I can see in Exponents Calculator but it shows as '4.4342648824304E+38'.
Can I show exact value though its very long (more than 15 digits)?

2. Can I calculate how much time required for print truth table without printing it in console or without running 'generateTable' function?

3. How to optimize program so if n = more than 20, then CPU utilization will not increase as right now?
1 month ago
Sorry for Images not shared properly in previous reply.
Local Repository Architecture

Cloud Repository Architecture

Link of album is google photo
Thanks Tim,

I am trying to write Java Swing Desktop Program for Document Management.
Architecture which I consider is as following image.

In above case I does not consider Internet or web or Cloud etc Advance things.

But I think as Tim Holloway wrote

These days, the repository access is generally done via a web interface such as WebDAV. In fact, Subversion itself uses WebDAV for its web server interfacing.

My program should be ready for cloud or web also.
So Architecture might be like follows:-

In Cloud I have to no worry about Backup Repositories if I use clouds like Amazon or Google or Microsoft Cloud provider, they take care of it. (As I read in articles.)
If Cloud server place at Locally then I have to take care of its all majors.

So I think my Current program (Desktop Program) as follows:-
Front End = Swing Java
Back End  = Advanced Java compatible for both LAN or Web/Cloud Repository.
Database = Local or Cloud Repository

Future program:-
Front End = Advanced Java Web UI
Back End  = Advanced Java compatible for both LAN or Web/Cloud Repository.
Database = Local or Cloud Repository

Documents I considered as I previously wrote pdf, doc, ppt, excelsheets, etc. For opening & editing I consider its respective Open Source or propitiatory reader-editors.
Users open-edit docs in their local machines, then run my program & do further steps to store it in Central Repository.

I started study of SVNKit to develop my current program as I think its my starting point of study.
For Creating Future program as

There are tons of web-based document management systems out there. In fact, the Wikipedia is a web-based document management system which is based on freely-available open-source code. Wikis are very popular as knowledge bases and repositories. Many of them even incorporate version control so you can track a document's history.

And speaking of version control, there's often a certain amount of document management in modern version control systems. GitHub-style repositories often have hooks in their web interfaces such that basic markup can be done to a file and the web interface will present it formatted. It has become somewhat of a convention that there will be a file in a git-based project that outlines what the project is about and (often) how to set it up and use it.

as I see GitHub have some monthly plans.
Need to study about MediaWiki or related projects. 

1. Which API is much better for Free of Cost?
2.  Is my approach is right for solve the problem?
Thanks Tim Moores,

Be aware that using svnkit might entail having to obtain a license, depending on how you use it. You could access the svn libraries via something like JNI or JNA, but it seems you want Java only.

1. I got that if I sell my program as software then I have to take commercial Licence.
2. For use this svnkit should I JNI or JNA?
I seen Apache SVN written in C. Should I use that Source directly as Library for JNI or JNA?

Have you considered proper document management systems, for which which there are several open source Java solutions? Apache Jackrabbit comes to mind as a JCR-compatible implementation, but there are others.

I want to develop Java Desktop application for manage Documents.
Admin1 create Repository Demo1 at Server & instruct user1 & 2 do design ppt.
So as Client machine, user1 create 2 pages & user2 create 3 pages at Day1.
Both modify/edit that ppt at Day2.

So Document management system with Versioning, commit with message,  etc features like tortoisesvn provides.

Can I use Jackrabbit for develop this kind of system or need other or combination of multiple API.
I search & found svnkit.
But does anyone use it in Java Swing Desktop program for as Server side Create Repository & as client side Manage Documents?
I am trying to design document management program in java swing as Desktop Application.
By that I plan to manage pdf, doc, exls, ppt etc non programming files only.

I used SVN for maintain current and historical versions of project files such as source code, web pages, and documentation.
VisualSVN I used.
So I decide to use that but not found any API library to integrate SVN in java swing program.
Is there any library available for SVN Server & Client so I can import it & use it?
Is there any other way to manage Documents more proper & secure way?

Need Guidance.
Additional info:-
I download MySql Connector for above program from following Link:-
Connector/J 5.1.45

I found 'mysql-connector-java-5.1.45-bin.jar' file which I use as Library.
If I not use that then I got Exception as follow:-

4 months ago
I updated Java today & after it, I am facing exception.
My Java version is

I wrote very basic program.

Got Exception as follows:-

Need Expert's Help.
4 months ago

What should I write in for loop to print values?

Don't you have an IDE?

I am using Eclipse IDE Oxygen.1a Release (4.7.1a).

Here I post 4 Screenshots:-
1. resultList

2. get_combined_two_tables()

3. combined_table_List

4. java.lang.ArrayStoreException
I put Breakpoint & try to find out where I get problem.
I got following result when I put break point at 'combined_table_List = get_combined_two_tables("Mandar");'

I got following Result when I put breakpoint at 'System.arraycopy(combined_table_List, 0, dest, 0,combined_table_List.get(i).toString().length());'

Still not understand why following line fail

You will need to cast to read them.

Normally I cast as follows when I fetch table1 & table2 separately in table1_List & table2_List:-

But when when I get result from combined 2 tables then how to cast List to read them?
Copying Array is right way to do that?
Thanks Dave Tolls,

I have no idea what these lines are supposed to be doing:

I implement given code & got following exception.

Got print following line:-

Now how to solve it?
Thanks Dave Tolls,
Using following code I get no error in java program:-

But I got problem when I try to convert Object Array for print values.

When I print combined_table_List.size() & comment for loop. then Got following output, without exception.

As I understand now no need to cast table1 or table2, in for loop with combined_table_List, to print column values right?
Then how to print values from Object List?
Need more guidance to print 4 variables from table1 & table2.