1
vote
2answers
22 views

java.sql.SQLException: Parameter number 2 is not an OUT parameter

I am getting an Error while running this: 1. cs = getCon1().prepareCall("{CALL SaveLabourWageDetails(?,?)}"); 2. cs.setString(1, user.getUserId()); 3. cs.registerOutParameter(2, ...
0
votes
1answer
24 views

FIFO Cost Calculation

Namaskaram, I am developing a Retail POS application in Java Swing with H2 database. For calculating the cost, I need help. FIFO Cost Calculation I have the following tables Purchase Table ...
0
votes
0answers
11 views

java.sql.SQLException: [Microsoft][ODBC dBase Driver] External table is not in the expected format

I am opening two .dbf files. One is a master file and one is a file with new data. I wish to insert the new data into the master file. I am connecting to the directory that holds the files like so: ...
0
votes
1answer
29 views

Both output is false in sql check

I'm trying to let my app look through my sqlite database an look for, if a row is the same as the string received. But I can't figure out how to do it, the code I have gives me false if it's in the ...
-4
votes
1answer
32 views

Writing Hibernate Request [on hold]

I want to write a Hibenate Request, my Sql Request is like this : Select city , count(*) from user group by city; Thanks !
0
votes
3answers
44 views

Storing Count value from query

How do I store the returned count value into a variable, so I can then set a attribute with it? This is my method so far: public List<Sighting> total() { return jdbc.query("select ...
-5
votes
0answers
49 views

How to call a java function from database trigger [on hold]

Is it possible to call a java function from database trigger? if yes then please suggest the steps with example. I'm using oracle 10g.
0
votes
1answer
25 views

Spring JDBC query for count of a specific field

I would like to know how I would get the count of a specific column within my database. Each distinct value in my column I would like to store the returned column value and its count within a Java ...
0
votes
0answers
13 views

DISTINCT ANDROID builder.distinct().selectColumns()

How can I use disctict in this request : Dao<HoraireDb, Integer> dao = App.getHelper().getHoraireDao(); QueryBuilder<HoraireDb, Integer> builder = dao.queryBuilder(); Where where ...
2
votes
2answers
24 views

Howto setup this SQL query with CriteriaBuilder?

to select an overview from a database I have to use a statement like this: select a1.begin, a1.end, b1.name, c1.name, d1.name, e1.name, f1.name, ... from a2, b1, b2, c1, c2, a1 left outer join (d1 ...
0
votes
0answers
35 views

JPA .persist() doesn't save the data to the database while read works properly

I have a Spring/JPA (with Hibernate as the JPA provider) with MySQL as the database provider. I can't seem to be able to persist the data successfully even though I can read the data from the ...
0
votes
1answer
15 views

How to Convert Struts2 datetimepicker value to SQL datetime so that it can be saved to a SQL table

I am using Struts 2 dojo datetimepicker in my application. How can I convert my action class property of String type (which is a value from datetimepicker) to a SQL datetime so that I can save the ...
1
vote
3answers
52 views

How to securely implement SQL queries in a Java desktop app

I am creating a Java desktop application that generates and stores users passwords on a database. My question is: what is the most secure way to implement SQL queries in the application? Surely it ...
-1
votes
1answer
34 views

Export oracle database data through java code

I'm using Oracle Database 11g Express Edition to set up my database. The way I currently backup my database data is through SQL Developer. (Right click on tablename > export) Which will give me a .sql ...
1
vote
3answers
39 views

Insert special characters in JPA query with set parameter

Is there a way in JPA 2.0 to set parameter of a query with special characters? I mean, if I do: query.setParameter(field, "%" + value.toString() + "%");, it takes % as special (wildcard) character? It ...
1
vote
0answers
36 views

Criteria , have possibilities?

Well, I have the following questions, to perform the join between the tables by setting the nickname (alias), I need to make a decode, used the alias alias, but to use because it does not recognize ...
8
votes
0answers
103 views

How to track result set size using hibernate?

I'm trying to detect and optimize inefficient joins within a Java/Hibernate application. I've noticed that in some cases, due to the nature of how joins are handled in result sets, the over-the-wire ...
0
votes
1answer
23 views

Query from a timestamp based on a date? [duplicate]

How do I execute a query based on date? As you can see below, I have a table with the attribute PURCHASEDATE as a timestamp. My current query is String query = "SELECT t FROM TransactionE t WHERE ...
0
votes
1answer
26 views

SQLite Update or Insert, not Upsert

I am writing a simulation application and wand to add values into a table if they exists or just insert these as new values. Example table: CREATE TABLE "time_table" ("time_abs" INTEGER UNIQUE , ...
0
votes
1answer
30 views

Hibernate HQL issue expecting IDENT found “*”

I need to go whole datas from relative table so I'm using somethink like this (i would use it in sql) private static final String SELECT_OOPR_TO_SEND = "SELECT R.* " + ...
1
vote
0answers
17 views

Hibernate and @JoinFormula: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column

I'm trying to write a hibernate adapter for an old database schema. This schema does not have a dedicated id column, but uses about three other columns to join data. On some tables, I need to use ...
1
vote
3answers
55 views

H2: how to tell if table exists?

I'm trying to write Java code that checks to see if an H2 table exists: if it doesn't exist, it first executes a CREATE TABLE query that creates the table before it proceeds any further. I followed ...
2
votes
2answers
55 views

Eclipse data not inserting into SQLite Database and crashing

When I click on the button, it's supposed to store the typed data into the database, along with the longitude and latitude that has been collected from a separate activity. I'm unsure what I did ...
0
votes
0answers
29 views

java.lang.NoClassDefFoundError when running a java file from oracle

I'm going to jump right in. I have a java file called DBCon that connects to a database, and then runs SQL. When I run the java file in netbeans, it properly queries the information from the text ...
0
votes
0answers
59 views

Multi joins return an exact match, if any

I have 3 tables below (simplified) user | ------ id name conversation | -------------- id date_created conversation_user| ------------------ conversation user I have an ArrayList in Java with a ...
0
votes
1answer
30 views

Java : getting a referenced data base object and then modifying it

here is my question, given this code: studentOutcomeService.getAll() .get(getStudentOutcomeByID( selectedStudentOutcome.getId().intValue())) ...
0
votes
1answer
44 views

Dynamic Select SQL statements with MyBatis

I would like to have dynamic sql statements using mybatis in an Oracle 12g database where I can utilize a hash map to add conditionals something like the following: <select id="getUsers" ...
0
votes
4answers
59 views

Java mysql if Table Exists

Thanks for all the support so far in my epic battle for my learning Java with MySQL. What I want to do is check if the table exists. What currently happens is that if the database is created and the ...
3
votes
1answer
99 views

What does ^1 mean in SQL call?

SELECT LOWER(pla_lan_code) as locale, pla_auto_translate_opt_out_flag^1 as autoTranslationEnabled, pte_manual_edit_flag^1 as autoTranslated, ftr_created_date as queuedDate, ...
1
vote
3answers
37 views

SQL Access Select NOT IN from two tables

Hello i am quite new to using SQL statements and my SQL statement does not return the proper result. I have two tables Room (contains Room details) and Booking(contains ID of Room booked). The RoomID ...

15 30 50 per page