Search This Blog

Thursday, March 17, 2011

JNI and C++ FindClass method

JNI is a great way to use java class in your c++ code, in case you really need it, a good article with full sample could be found in the next topic.
How to Call Java Functions from C Using JNI - CodeProject
when consuming a class in jar file dont forget to:
supply the jar file in the option:
-Djava.class.path=D:\myJar.jar

and when you need to use the FindClass methos supply the full path:
jclass myClass = env->FindClass("mm/test/HelloWorld");

when you need a pointer to the method id , use full path to the parameter as well , in case you need it:
in java its define such:
public static WorkOrder2 ChangeTheObj(WorkOrder2 obj);
in your c++:
jmethodID myMethod = env->GetStaticMethodID(clsH,"ChangeTheObj","(Lmm/test/WorkOrder2;)Lmm/test/WorkOrder2;");
Yaniv Tzanany

Thursday, March 10, 2011

jTDS with sqlserver instance

jTDS is an open source 100% pure Java (type 4) JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, 2005 and 2008).
when connecting to sqlserver instance instance a valid jdbc url should looks like this:
jdbc:jtds:sqlserver://YanivServer:1433/mydb;instance=myInstance;user=sa;password=xyz

make sure the next stuff is configured and running:
open the "sql server configuration manager "

  • sql browser service (its turn off by default) is running 
  • goto sqlserver network configuration  -> 
    •  the protocol of the instance , and make sure the  TCP/IP  is enabled.

enjoy 
Yaniv Tzanany

Thursday, March 3, 2011

character converter - LibIconv for Windows

LibIconv converts from one character encoding to another through Unicode conversion (see Web page for full list of supported encodings). It has also limited support for transliteration, i.e. when a character cannot be represented in the target character set, it is approximated through one or several similar looking characters. It is useful if your application needs to support multiple character encodings, but that support lacks from your system
LibIconv for Windows

you can use it in your app , via is API , works well , multi platform solution.
enjoy
Yaniv Tzanany

SSO - WebSphere with a side of SPNEGO

This document is intended to provide instructions to configure SPNEGO for WebSphere Application Server in standalone and clustered configurations using Microsoft Active Directory as the Kerberos security server. It is meant to be a ‘quick-start’ guide, providing the minimum steps and default options required to get up and running quickly in both WAS 6.1 and WAS 7.0 environments