jdbc

I am using HP Fortify to measure code quality of my java code. HP Fortify is reporting SQL Injection error on PreparedStatement stmt = connnection.prepareStatement(queryString); so how to resolve this? --------------Solutions------------- if you don'

I am using java's interface DatabaseMetaData with a jdbc driver to an oracle database. The interface uses the term catalog as one of the coordinates for the database subsets. For example, in querying for procedures (getProcedures method). I'm not sur

Is it safe to alter the jdbc connection's settings during its usage? For example I need to access comments made on the procedures in the rdbms and plan to provide such a functionality in a dedicated method. But I've read in the documentation that thi

We have scenario where we want user to update certain tables in DB2. Which we are doing using a SP and transaction management is done for same. However, now we need to introdue one new table for logging user actions, but we don't want to keep user wa

I'm trying to create an sql statement in java that uses the timediff function to compare two sql date objects from a table. This is what my statement looks like: SELECT EMPLOYEEID, COUNT(ORDER_TYPE) AS BREAKFASTCOUNT, MIN(TIMEDIFF(ORDER_ACCEPTED_TIME

I have been following the steps outlined in https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients to set up JDBC connection between my program and Hive2. The code looks roughly like this: private static final String DRIVER = "org.apach

I'm not sure how to close the database through this method of database connection, it's opens and connects successfully, I don't know if it closes when I close the GUI it's coded to import java.sql.Connection; import java.sql.DriverManager; import ja

I am not able to set the server output to ON, while running the Java code. But I am able to connect to Oracle SQL database. Getting below error: ****java.lang.NullPointerException DB Connected successfully java.sql.SQLSyntaxErrorException: ORA-00922:

My requirement is to check can we connect to a database with no schema defined through a java program and create a database. this works fine Connection connection = DriverManager.getConnection("jdbc:db2://wcspocca-db.cloudapp.net:50001/db2inst1"

I'm trying to insert html-form data into my database using the script below but when running the app I receive this error message: Error..com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'first_name' cannot be null W

I have a java MVC architecture (Simple MVC not used any Framework) which will connect to the database. A query will fetch the time-stamp value which is in the MySQL DB. But I am not getting the expected output it is throwing an exception. Expected ou

I want to connect to a db via dbGetQuery. For this purpose I have something similar to (using SQL oracle): v <- "Variable_Set_Pri" output <- dbGetQuery(con,paste('select *', ' from Set_Name', ' WHERE Descr = ', v , sep="")) where

I am trying to use mysql as JDBC store and loader for infinispan. I want to preload the existing data in mysql table into cache. Below is the configuration and the code I have used. EmbededCache embededCache = new EmbededCache(); ConfigurationBuilder

I am using genjdbc input plugin for Logstash to get data from a DB2 database. It works perfectly, I get in Kibana all the database columns as fields. The problem I have is that in Kibana all fields are string type, and I want the numeric fields to be

I'm trying to make a RestAPI with java for CRUD operations over a OrientDB database. I made a test Path that looks like this: @GET @Path("/test") @Produces({"application/json"}) public String test() { JSONObject result = new JSONObject

I am trying to access a HIVE table using JDBC driver. When I try to execute the class using maven the execution hangs and stays like it forever on the console. Following is the console output when I try to run the class :- [email protected]:~/workspac

I am facing java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). while updating one or two columns of 'reset_info' table which has five columns (id, mobile_tower_id, reset_value, date_time, clientip). 'id' is