Erick
Erick

Reputation: 2608

Can you use the SAP JCo connector with SCALA?

Goodnight Stackoverflow.

I've been using the JCo recently with Java, and I think it's great, but I have been using SCALA more and more recently as more of a hobby and something I find makes programming more pleasing.

For those that don't know what the SAP JCo is and want to save yourselves a search:

SAP Java Connector (SAP JCo) is a middleware component that enables the development of SAP-compatible components and applications in Java. SAP JCo supports communication with the SAP Server in both directions: inbound calls (Java calls ABAP) and outbound calls (ABAP calls Java). SAP JCo can be implemented with Desktop applications and with Web server applications. Source

And I got curious, is it possible to use the SAP JCo connector together with SCALA? I know there isn't a direct way to do so, but does anyone have experience doing so? It'd be a highly attractive solution to me. I prefer programming in SCALA over Java when possible, and my company is not that big so I often undertake entire programs by myself, which means I wouldn't be affecting anyone by using SCALA instead of Java.

Does anyone have any experience with this? Cheers!

Upvotes: 2

Views: 529

Answers (3)

Jelmo
Jelmo

Reputation: 116

I recently wrote a small library in Scala on top of SAP JCo (closed source, sorry). Not sure what you mean by "I know there isn't a direct way to do so": as already said in other answers, JCo is a Java library and as such it can be used seamlessly from Scala. The fact that JCo wraps SAP native libs (.so, .ddl) doesn't matter from the point of view of Scala.

Upvotes: 3

Jeroen Kransen
Jeroen Kransen

Reputation: 1471

Scala compiles to Java bytecode, and indeed they can be mixed and matched. One thing you may want to consider is if you have colleagues who are able to modify and extend your code if necessary. It's great that you have so much leeway, but I don't think you want to be in a situation where you are always the only one who can fix things.

Upvotes: 2

vwegert
vwegert

Reputation: 18493

I'm not a Scala expert, but its Wikipedia entry tells me that

Java libraries may be used directly in Scala code, and vice versa.

Since the part of the JCo that you interact with as a developer is a Java JAR library, this should apply as well.

Upvotes: 2

Related Questions