classFoobar{publicvoidtest(){Sessionsession=sessionFactory.openSession();Queryq=session.createQuery("select t from UserEntity t where id = "+input);q.execute();}}
Compliant Code Examples
classFoobar{publicvoidtest(){Sessionsession=sessionFactory.openSession();Queryq=session.createQuery("select t from UserEntity t where id = :userId");q.setString("userId",input);q.execute();}}
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- java-security # Rules to enforce Java security.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines