B4J Question jRDC Setup details required

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

I am new to B4J.

I downloaded the sources for jRDC. When I opened the project in B4J it said that a library named "ByteConverter" is missing. Searched the forum and found this library for B4A. I downloaded it and copied it to the Additional Libs folder of B4J

Is is OK, if I use the B4A's "ByteConverter" lib ? or is there a separate "ByteConverter" lib available for B4J ?. Anyway a search could not find a "ByteConverter" lib for B4J.

Once I started compiling the B4J jRDC project, it gave the following error

Cannot find: C:\Program Files (x86)\Anywhere Software\B4J\libraries\mysql-connector-java-5.1.27-bin.jar


Went to the site http://dev.mysql.com/downloads/connector/j/ to download mysql-connector-java-5.1.37

Extracted the zip and found mysql-connector-java-5.1.37-bin.jar in it.

Now my question is where should I put this mysql-connector-java-5.1.37-bin.jar file ?

Is it to the B4J Additional Lib folder
OR to
C:\Program Files (x86)\Anywhere Software\B4J\libraries\ as said in the error message

In B4A we used to copy all to the Additional Libs folder. In the downloaded jdbc zip file there are many files available. Do I need all those files ? OR just the mysql-connector-java-5.1.37-bin.jar file ?


Any help will be appreciated.

Thanks and Regards

Anser
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is is OK, if I use the B4A's "ByteConverter" lib ?
Yes. You should use the B4A ByteConverter library. It is compatible with B4J.

You should put the mysql jar in the additional libs folder.

Only mysql-connector-java-5.1.37-bin.jar is required.

Note that you don't need to copy it anywhere. It will be merged into the compiled jar.
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
I got it working. Thank you. :)

During my initial test, I found that the problem regarding the Alias Column name which was there on RDC has vanished. ;)

I tried to compile it to a library so that I can test it on my VPS Server. Unfortunately, when I tried to compile it to a library, I am getting the following error message. I am sure that it's something wrong with the way I am doing it.:confused:

Screen Snapshot of the error
B4_J_Error.png




I would like to get clarifications on the below mentioned points :-
  1. After successfully compiling jRDC project, it will be a single .jar lib file, right ? Erel has already confirmed that mysql-connector-java-5.1.37-bin.jar will be automatically merged into the .jar lib file.
  2. What about the Config.Properties file ? Will this file also will be included in the generated .jar lib file ?
  3. Do I have an option to exclude the Config.Properties from the .jar file ? If the file Config.Properties resides as an external file, in future, if I ever need to add few new SQL statements OR modify existing SQL statements, I can do it without having to recompile and build the .jar lib file
  4. If I have the option to exclude the Config.Properties file, then where would the Lib expect the Config.Properties to reside ?. I mean the path of Config.Properties file.
  5. I would also like to know the possibility of including Config.Properties into the .jar lib file so that after all debugging and while releasing the application its just a ONE SINGLE FILE.:)

EDIT:- Reading the code, I understand/assume that Config.Properties file will also be included in the .jar lib file. The file is read from File.DirAssets

Thanks & Regards

Anser
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You don't need to compile it as a library. You just need to run it in release mode and then copy the jar file to your server.

1. Yes.
2. Yes.
3. Yes. See how the config file is read and change it to load from a different folder.
4. See above.

See this tutorial: https://www.b4x.com/android/forum/threads/34672/#content
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
Thank you for providing the clarifications.:)

I hope that, in B4A, I should continue using the same DbRequestManager Class Module (used in B4A) and that there are no changes in that Class Module pertaining to jRDC.

Regards
Anser
 
Upvote 0
Top