Tagged Questions
1
vote
1answer
12 views
Adding SQL Objects to a JTable
So I'm currently working on a GUI for a school project, where we are making a Hotel Management System. Currently my task is to populate a jTable with some objects from our SQL database.
I have read ...
0
votes
5answers
18 views
Many subscribers for many shops
I have many shops in Shop table and many users in User table in DB.
User can subscribe to any stores.
How can I create table for this task? First column with shop name and second column - string ...
0
votes
1answer
20 views
How to merge same field for two records in single sql table
Am maintaining a data base named CustomerInfo for multiple employees, whenever a customer contacts me am inserting that customer details into the table.... If the same customer calls again and again, ...
-3
votes
1answer
12 views
Output SQL data from derby database using java servlets in html table [on hold]
i want to output data from derby database in HTML table using java servlets. if you have any suggestions please help. i looked up in google but there were solutions using php.
0
votes
3answers
24 views
Is there a way to add a local database to a netbeans java project package?
I have a java project I need to write that reads data in from a comma delimited text file.
But, for extra credit we can use a database instead of a text file .
I dont want to pay for a host or deal ...
-2
votes
0answers
23 views
a different result (JAVA, MS ACCESS, SPRING)
I am maintaining an invoice sending system using JAVA(Spring 3.0, JDBCTemplate) with MS-ACCESS on Window platform. My problem is that when I retrive one of the table, the number of ResultSet is ...
0
votes
1answer
21 views
SQL: How to optimize 3 nested selects in JDBC program?
In Scala program I use JDBC to get data from a simple table with 20 rows in SQL DB (Hive).
Table contains movie titles rated by users with rows in the following frormat:
user_id, movie_title, ...
0
votes
3answers
17 views
Delete Rows in Two Tables with Java and SQL
I have connected Java to SQL and want to delete two rows from different tables, but having issues with my Java Method. I am trying to delete from both tables because I can't delete ID from Table1 ...
0
votes
1answer
15 views
Java hibernate: Update foreign key in manytoone relationship automatically
I have a problem with the auto update of foreign keys which appears as following:
I have a two tables HamKeyword and HamKeywordAlias. One entry in the hamKeyword has 0…n entries in HamKeywordAlias. ...
0
votes
1answer
23 views
rs.next returns only one result in java
I am attempting to run following code :
ResultSet rs=DatabaseConnection.executeQuery("Select * from csr where c_No="+this.c_No);
if(rs.next()){
ob_id=rs.getInt("ID");
}
ResultSet ...
0
votes
1answer
16 views
encoding utf 8 java jdbc oracle
Hello i have 3 projects .
web application encoding utf-8 . There is servlets, jsp ,html pages etc
java app project - utf8 - classes to set a jdbc connection do database oracle
another java app ...
0
votes
3answers
21 views
Which java datatype to use in a hibernate entity to represent id colum in a database
I am designing a database for a web application. I am using Hibernate ORM framework to persist data to the database.
I was wondering which java data type should i use to represent the id columns? in ...
-4
votes
1answer
19 views
Error inserting into SQL table with Java [on hold]
This is my java file code. I am not able to figure out the error.
public class KeyGen extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse ...
1
vote
1answer
30 views
How to use row value expressions in jOOQ?
The jOOQ blog claims that it is one of ten more common mistakes that Java developers make when writing SQL to not use row value expressions where they are supported.
Their recommendation is to issue ...
0
votes
0answers
28 views
To evaluate sql file using scanner in java
i have to evaluate a SQL file for correct syntax using scanner class in java. how is it possible? the steps i followed so far:
File text = new File("C:/Users/Desktop/sample.sql");
Scanner scnr = new ...
0
votes
1answer
26 views
Where to place joins in 3 tier architecture
I'm trying to implement three tier architecture. Where i need to put the join statements of my database query?
i.e, If i have a Bill class it will have two tables BillingMaster and BillingDetail. For ...
1
vote
2answers
26 views
How does resultSet store values
I'm running a query that loads into a ResultSet. When I'm creating my object from the ResultSet I use various get methods of the ResultSet. Does the ResultSet store all the values as Strings no matter ...
0
votes
1answer
31 views
How to get Auto Generated ID from SQL Table when multiple users working simultaneously
Am creating a SQL Database for multiple users(Roughly 100 user), each records having nearly 15 fields in it.. In which the ID field is auto incremented...
Whenever a person Inserting a record to the ...
-2
votes
2answers
40 views
Updating SQL Table with Java
I am developing an application that can update my database... However, I can't get my Java method working correctly. It gives me the following error: Must declare the scalar variable "@P0WHERE". Any ...
-1
votes
1answer
28 views
JDBC: OutOfMemoryError when running the `insert` query on MySQL
Please have a look at the below code
KeyWordTableCreator.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class ...
0
votes
2answers
25 views
Inserting into database table with auto generated numbers through javascript
I Have created a from for my website. My form posts into two separate tables, namely: 'members' and 'users'
My form seems to input into my database fine, apart from under Membership Type ...
1
vote
1answer
25 views
BigQuery RANK() in Having or Where Clause
In BigQuery I have a query that uses the RANK() function to group users by total count across sources. I only care about the top 10 users. Currently, I am doing the RANK() function in a sub-select ...
1
vote
1answer
30 views
MySQLSyntaxErrorException: Error in SQL Syntax
Please have a look at the following code
public int insert(int index, String hashWord)
{
String str="";
int result=0;
int returnResult=0;
try
{
...
0
votes
1answer
20 views
SQL connection works in normal Java but not Android
The title kind of says the most of it but I want to connect to SQL using my Android app that I have in development so I made a sample set of code just to test the concept without using android and it ...
0
votes
1answer
15 views
Not Unique Table Alias error in java
I have 2 tables:
error table
id, loc, no, mesg, psg, stu, auth
user table
id, name, sname, ptg
id's are primary keys, ptg and psg have same records,
And this is my SQL syntax that I use in ...
0
votes
2answers
24 views
how to make a socket server for multiple clients
I have seen a lot of tutorials on client/server chat rooms using sockets, I am trying to create a instant messenger which will allow users (stored in a sql db) to chat with there contacts and ...
2
votes
4answers
68 views
Printing all columns from “Select *” query in java
I want to know how to print "Select *" query in java ? I tried this function but it give me this message "invalid column name "after execution.
public static void ask() throws Exception {
try {
...
0
votes
1answer
33 views
Hibernate cannot make distinction between columns with the same name
I have a table called cinema with a column ipaddress.
I have a table called tms with a column ipaddress.
When I perform the query specified below, the t.ipaddress returns the value of c.ipaddress. ...
0
votes
2answers
29 views
Static list MINUS select statement
I have a java program that returns a list of Long values (hundreds).
I would like to subtract to this list the values obtained from a select on an oracle database,
something like this:
SELECT 23 as ...
0
votes
1answer
29 views
How to get an elapsed time for this?
I am creating a Spigot (Performance savvy fork of Bukkit (Minecraft server software)) plugin that communicates with a Bungee (Proxy server for managing multiple spigot instances) server.
I have a ...
0
votes
3answers
18 views
MySQL Trigger to start Java Application
I have a web application that inserts a row with a future time in the MySQL DB. When the current time is equal to the set time in the entry, I want a java application to start doing some work based on ...
0
votes
1answer
30 views
Only Partial Data Returned from Database Using JSP Form
I'm new to mysql and teaching myself the ropes. I've come across a problem and hoping for some advice.
I created a form in a jsp page to insert data to a mysql database. All data is properly ...
0
votes
0answers
10 views
Can not create a database in my computer. java.sql.SQLNonTransientConnectionException error
I can not create a database in my computer. When I tried changing the java.policy file, it denied my access. I don't know what's going on. But on netBeans I saw this error:
"An error occurred ...
0
votes
1answer
16 views
“Invalid Column id” error when counting unique value in Java
I am using the following sql query in my java program:
SELECT COUNT(*) FROM event WHERE externaleventid ='1256294';
But I have an error as:
Invalid Column id.
Same query works fine in SQL ...
0
votes
1answer
16 views
Delete From JPA Query with Inner Join
I keep getting errors when trying to get this SQL correct for a JPA repository delete. What is the correct syntax?
@Query("delete * from TS t inner join TSC c ON t.tenantId = c.id where t.id= ?1 AND ...
0
votes
2answers
11 views
Not able to retrieve data after executing preparatory statement in Eclipse after JDBC Connection
Here is the preparatory statement I am using after making jdbc connection (Using SQL Developer) but on execution I am getting the following error
...
0
votes
3answers
20 views
JPQL - ManyToMany Self reference
I'm having a problem to make a query with JPQL. I have one table with reference himself with Many to Many:
@Entity
@Table(name = "item")
public class Item extends BaseModel implements Serializable {
...
2
votes
1answer
45 views
java.sql.ARRAY to ArrayList<String[]> OracleCallableStatement [duplicate]
I'm getting an ARRAY from oralce sql in java and write it to java.sql.ARRAY. This array is type of VARRAY of OBJECT. How can I convert this type to ArrayList?
0
votes
2answers
24 views
JDBC and MySQL: Do changes in the underlying database are known to the java program?
Suppose that, after I establish a connection of my java application with my underlying MySQL database, and then open MySQL workbench and update some rows in a table, and then retrieve the fields of ...
-4
votes
0answers
28 views
Get data from table with necessary time
I have table with column _date_added. I got current time using System.getCurrentTime(). How I can get data from tables, which differ from the current time is greater or not less than 15 minutes?
0
votes
2answers
46 views
extracting data from multiple tables in sql db
Hi i have a database which consists of 2 tables
userData table
userID | userPass | Firstname | Surname | Status | IPAddress
--------------------------------------------------------------
110110 ...
-4
votes
1answer
31 views
how to Performe a select query on two tables in sqlite android
//I've created two tables one incomes and expenses using.
public static final String createxpensestable = "CREATE TABLE "
+ TABLE_EXPENSE + " (" + EID
+ " INTEGER PRIMARY KEY AUTOINCREMENT, " + ...
0
votes
0answers
32 views
How does Hibernate generate sql string from session.get queries
I am using Hibernate 4.2.4 and I am interested to know how Hibernate translate a session.get call to an equivalent sql query that is eventually used to retrieve rows from database. I do not want to ...
0
votes
3answers
37 views
Why will following sql-statement not work with JDBC?
I am programming a basic database management system in java. When the user submits his username and password, the program will search in a database of the submitted data is correct:
result = ...
0
votes
1answer
7 views
Domain error during implicit conversion of VARBINARY value to a NUMERIC field?
I m getting this error while update one of the table. Any idea in which case this error might occur?
I use sybase 12, java 7 with hibernate.
My column type in sybase is Numeric(19,0) and data type in ...
2
votes
1answer
32 views
if (specialmarkId != null) {…} got ignored
I am using auto generated JPAController of Netbeans 8 using Java 1.8.
public void create(Physical physical) {
if (physical.getTalentCollection() == null) {
...
0
votes
0answers
31 views
java - inserting and updating a table using a glassfish web service (jpa)
i am working on a function that helps the user to transfer "money" from one account to another . this function works by removing the amount from the first account (compte1) and inserting it into the ...
2
votes
1answer
35 views
No suitable driver found when making SQL connection to MS Access Database in java
I have a Jbutton (GetDataFromDB) in a simple java application that is suppose to load the data from the database depicted in the path in the code below into a Jtable in the application.
Edited ...
0
votes
1answer
28 views
Create column with update statement
Is it possible to create a row with an update statement if it not exists? I am using java with mysql and i want to save some user data. If the user does not already have a row it should be created.
0
votes
0answers
17 views
How can I add a non-editable informative table to textview in Eclipse?
I have on Microsoft Word Document some informative tables(that contain some basic information).
I'm using Eclipse on Windows 7.
I need to know how can I insert those tables(specifically 2 columns and ...