Connect to sql server database

I want to connect sql server databse via camunda( more clearly i want to write data parsed by script processor into spl server databse) i have added this configurations inside my conf/server.xml

 <Resource name="jdbc/ProcessEngine"
         auth="Container"
         type="javax.sql.DataSource" 
         factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
         uniqueResourceName="process-engine"
         driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 
           url="jdbc:sqlserver://localhost:1433/camunda;MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE"
          defaultTransactionIsolation="READ_COMMITTED"
        username="sa"  
       password="****"
      maxActive="20"
        minIdle="5" />

and i want to know what should i configure or add inside my camunda project or camunda modeller to make my project write this data inside databse tabeles?

Can you link me any example or tutoria whiach can help me implement this logica i have already read thsi https://docs.camunda.org/manual/7.4/user-guide/process-engine/database/

Hi @Sally,

how do you want to access the database from your application? Do you use Spring, Java EE, JDBC, etc.?

Is the question regarding the same use case like you ask in this thread? If yes, please don’t open different topics for the same question.

Cheers
kristin

Are you familiar with how do these things in a plain, non-Camunda Java application that you run on Tomcat?

If the answer to that is no, then please do this step first. You will find plenty of resources on the web on that topic. As this is not directly related to Camunda, we may not be able to assist you with that.

If the answer to that question is yes, then please share how you are doing that, and we can show you how you can do that from within Camunda processes.

1.I have added sqljdbc42.jar into tomcat lib folder
2.then i have added sql server configuartion in conf/server.xml
3.i have added this dependencies inside my maven war file:

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
			<groupId>com.microsoft.sqlserver</groupId>
			<artifactId>mssql-jdbc</artifactId>
			<version>4.2.2.jre8</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>5.2.3.Final</version>
    	</dependency>
  </dependencies>

3.i have added several entity class inside my src /main/java folder
4.i have added this inside my web.xml

<resource-ref>
    <description>Connection Pool</description>
    <res-ref-name>jdbc/confluence</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
</resource-ref>

what i am missing?

Now i am using jdbc, what kind of rest api does camunda support?

Hi @Sally,

JDBC is fine.
the Camunda REST API uses JAX-RS based Rest API.

Cheers
kristin

thank you for your reply i am using rest service for connecting database and writing ( and getting data from and to it) , i am using this kind of configuration see this link :https://stackoverflow.com/questions/48522338/springconnect-sql-server-from-spring-boot-service/48522577?noredirect=1#comment84041387_48522577

and i want to know :1. if is it possible to write and get data by post and get request from http rest connector 2.if there is more flexible way to do this operation without rest service?