Question

I have an iPad application for restaurant where I need to take live order that is made.

Webservice is provided by .net & for database I have SQL Server 2008.

To get live order, I am using TCP in Java.

When the order is made, I execute one JAR file through .NET.

In JAR file I have java code where I am connecting to database and fetching the data.

Now to get connected to database, I have to include jar file.

I am creating JAR file manually by using below statement.

jar -cvfm ServerOrders.jar manifest.txt *.class

To include another jar file, what I did is added sqljdbc4.jar file in folder and added jar in the above command. New command looks like below.

jar -cvfm ServerOrders.jar manifest.txt *.class *.jar

But still it gives me java.lang.ClassNotFoundException: com.microsoft.sqlserever.jdbc.SQLServerDriver

I think that means, the sqljdbc4.jar is not getting executed.

Any idea what is going wrong?


String DB_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";

Answer

This was happening because I didn't add sqljdbc4.jar in manifest file.

Class-Path : sqljdbc4.jar

Once I add above, it didn't give any exception.

Was it helpful?

Solution

This was happening because I didn't add sqljdbc4.jar in manifest file.

Class-Path : sqljdbc4.jar

Once I add above, it didn't give any exception.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top