Tagged Questions
0
votes
0answers
14 views
JPA 2.0 How to handle deadlock (Eclipselink JPA2.0 MySQL)
I trying a code to add/get/update and I have used EclipseLink provider and JPA2.0. and MySQL.
The below code is throwing an error saying a deadlock happened. The issue is happening randomly. I ...
0
votes
1answer
24 views
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'hourId' cannot be null
My project is faculty allocation. when i try to insert data, it shows the following exception.
"com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Column 'hourId' cannot be ...
0
votes
0answers
14 views
DatabaseMetaData is not working properly
I have Created A DataBase named CSTATE in MySQL 5.5
and create a table in it named BAVTX000
Now In Java Class i have create connection. Code below
try {
connection = ...
-3
votes
2answers
34 views
Java: You have an error in your SQL syntax
Hello I am currently getting this error:
java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to ...
-8
votes
2answers
45 views
how to conceive this model in database
i have to conceive the following model:
i've patients and 4 specialities (dermatology, nutrition, Lazer, mesotherapy)
so each patient can belong to one speciality and one speciality can have several ...
0
votes
0answers
20 views
using rs(next) but got TYPE_FOWARD_ONLY in SQLite
I try using SQLite after sucessfully used mysql database on simple CRUD java programs
using this driver: http://cdn.bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.7.2.jar i got this error:
...
0
votes
1answer
27 views
Transaction atomicity with MySQL, MongoDB, RabbitMQ
I have a Java project with these 3 datasources: MySQL, MongoDB, RabbitMQ.
I'm trying to find a way to execute "transactions" (because MongoDB isn't, in fact, transactional) on all 3 datasources as a ...
0
votes
1answer
17 views
Java Project Error after changing database from MySQL to SQLite
i am learning java
i have created simple (CRUD) java program utilizing mysql,its works fine
and i want to try switching to SQLite with the same database(i already converted mysql database to sqlite)
...
0
votes
2answers
14 views
sync data to server android
I'm new to android sync so I really need ideas to get started. Actually my app's requirement is like this: My app needs to connect to my database online. But my android app can be used offline ...
0
votes
0answers
22 views
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
I have a google app engine connected project with which I am trying to connect to a google cloud sql database.I upload my project to google and via it I try to connect to the db.
my connection URL is ...
1
vote
1answer
13 views
Building ordered and limited delete request in jooq
I recently encountered the following problem with buiding queries in jooq (version 3.1.0):
I want to build delete statement with order and limit constraints. So, my aim is to build something like ...
0
votes
3answers
36 views
How do I insert Java variables into query through textfields?
I am trying to create a register system for my MySQL database. I have a Java form that I created, in which the user inserts a username, password, and their email. I take that infromation and store it ...
1
vote
1answer
48 views
How do I insert Java variables into a MySQL query?
I am trying to create a register system for my MySQL database. I have a Java form that I created, in which the user inserts a username, password, and their email. I take that infromation and store it ...
0
votes
0answers
23 views
JAVA-MySQL Multi-threaded Application design [on hold]
I am trying to design a multi-threaded application in java. The application takes data from a MySQL database and processes it. Like with all parallel applications, there is synchronization problems ...
0
votes
1answer
20 views
How to retrieve an image from mysql using json? [on hold]
I'm trying to get a blob from my mysql but using json. Here is my code:
public class ClubVO {
private long _id;
private String nom = null;
private byte[] imageClub = null;
public long ...
0
votes
2answers
25 views
Java persistence eclipselink mysql example: error in sql syntax
I have this simple class Book:
package it.mysql.beginner;
import java.util.Date;
import javax.persistence.*;
@Entity
@Table(name = "books")
public class Book implements java.io.Serializable {
...
1
vote
7answers
57 views
How to return false where the result of JDBC is empty
In my code, i need when the result of query is empty, it should return false.
My code:
public boolean user_bookValidationQuery(String userID, String bookID) {
Connection con;
...
0
votes
2answers
26 views
How to create Single Page Application (SPA) in java with hibernate and MySQL
I'm trying to choose best set of tools to create Single Page Applications. I would like to be able to use Java and Hibernate on server side along with MySQL. But what about ajax layer of SPA?
Maybe I ...
0
votes
0answers
8 views
Glassfish 4 no password credential for resource
I have set up a project to use Glassfish 4 with a resource that links back to a MySql database and I am using Eclipse Keplar. I have set up the connection pool with the relevant details and pinging it ...
0
votes
3answers
54 views
search database by date
I want to search column called name in my work table by searching date. Other columns are id(primary key) and mydate. I can't find what is wrong with my code. I'm using jdbc class for db connection.
...
0
votes
2answers
31 views
Averaging column values in rows
I am trying to make a query for a chart in BIRT. I have a table similar to the following:
id score_1 score_2 score_3
1 80.5 81.2 81.3
2 90.1 88.9 87.1
3 85.6 ...
0
votes
0answers
10 views
If I want to use protocal jdbc:mysql:loadbalance, where can I download corresponding connector jar?
I build a master/salve mysql replication. Master is userd to write/read. Slave is used to read. If I want to read data, I use protocal jdbc:mysql:loadbalance://" + "master:3306,slave:3310/test?"
If I ...
0
votes
1answer
19 views
Retrieve separate elements from a mySQL array field and iterate to create map
Because I'm using a map interface in Limesurvey, my mySQL database populates a "text" field in my table 'geo' like this:
27.059125784374068;-102.65625;CITY;STATE;COUNTRY;
The code I use in the ...
0
votes
1answer
12 views
Invalid operation at current cursor position. (Java Databases)
I am running the following code to get data from database..
public String getCurrentSeason(String leagueName)
{
String qry = "Select * from KHAN.LeagueSeason where league_name = '"+leagueName+"' ...
0
votes
1answer
24 views
My data goes into my MySQL database, but it still gives a duplicate entry error, while I'm getting the error SingleClientConnManager in java
I'm trying to make a register page for my android app.
I have managed to create a login page and I'm now trying to get the register page to work.
I've managed to get the data I'm sending via the ...
0
votes
2answers
32 views
Coordinates to address script not working [on hold]
My intention is to:
I will get coordinates, convert the coordinates to addresses and show markers with infowindow on map. I have the code:
http://www.aktivitetsportalen.net/test/coordinates.html
...
0
votes
1answer
33 views
Why it is wrong to use jdbc in android application? [duplicate]
I've heard a lot of times that it was not recommended to use JDBC driver in an android application but I've never really seen a real argument.
Actually, i'm developping an android application which ...
0
votes
0answers
23 views
spring, hibernate - planner/term reservation [on hold]
I'm looking for something, what can help me implement planner/term reservation in Spring. specifically I want to make reservations for several rooms. I find JavaPlanner - JavaPlanner. Maybe someone ...
-1
votes
1answer
25 views
JDBC CommunicationsException: Communications link failure
I am trying to connect a Java swing application to a MySQL database using JDBC.
It worked perfectly with the local MySql db. I used this connection string to connect to that.
Connection GetConn = ...
0
votes
1answer
33 views
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'purchased1_.DTYPE' in 'field list'
Hi i am facing some problem while i am trying to get the data my schema defined is as below
purchased.java
@SuppressWarnings("serial")
@Entity
@Table(name="purchased_listing")
...
0
votes
1answer
24 views
delete MySQL dump files
My procedure is : first dump MySQL file then i am creating new file from this dump file then deleting dump file.
I am trying to delete MySQL dump file by following java code ...
0
votes
1answer
19 views
“Ping Connection Pool failed for MySQL. Communications link failure due to underlying exception” Glassfish 4
I followed this tutorial here:
Creating and configuring a MySQL DataSource in GlassFish Application Server
In step 10, The info I've provided as follow (assuming my database name is Jsf_demo):
...
0
votes
0answers
38 views
If database is empty fill default value [on hold]
I'm developing a web app that requires default value to the database. The default values are about 100 records. What I want to do is to check the database and if it is empty fill it up but:
I don't ...
0
votes
0answers
19 views
Which server is better in terms of performance load balance in real time? [on hold]
I have been assigned with developing a web application which will allow users to register by supplying theirs personal, academic and other details. Such kind of application is nothing new, but the ...
0
votes
1answer
20 views
How do I move to next record in the database using a button in jsp
So I finally got my information to display in the text bar
but cannot figure out how to move to the next record. Any help would be appreciated.
this is what I have so far
<html>
...
-1
votes
0answers
21 views
Get the output of select statement in java [on hold]
Hi I am getting a list of uploaded things in my Amazon S3 bucket. What I have done is whenever I am uploading data to S3, I also insert it into a mysql database.
Now if I want to display all the ...
0
votes
1answer
27 views
MySQL syntax error with commas? - Java
I'm trying to insert some data in a DB but I'm having some troubles. Currently I can't add data to my table and I don't know why.
I'm using some generic methods that you don't need to understand, ...
0
votes
2answers
38 views
Java - Trying to establish a connection with a remote SQL Database
I'm trying to connect to a remote SQL database that I can access via web through http://smart.ihu.edu.gr/phpmyadmin/. The database inside that is awesomedb/pwndoes'. That's where the tables that I ...
0
votes
1answer
24 views
foreign key constraint fails - hibernate
I have problem when i try add data to table USERS. First my DB and classes.
DB structure:
CREATE TABLE IF NOT EXISTS `admins` (
`ADMIN_ID` int(10) unsigned NOT NULL AUTO_INCREMENT ,
`USERNAME` ...
1
vote
1answer
20 views
Java DBCP keeps creating new connection
My DBCP configuration keeps creating new connections, so much that my MySQL server blocks it because of too many connections:
public class SQL {
private final static String DRIVER_CLASS_NAME = ...
0
votes
1answer
29 views
Does jdbc support persian language
I designed a java desktop application using jdbc technology to connect to mysql database.
But when I want to store a data in my db which is in persian language it saved like some ????
I tried ...
0
votes
1answer
35 views
How to find database name present in MySQL dump file?
I already export MySQL database.Now i want to know database name present in dump file through java code.I require this because, if database present in dump file is not present in server then first i ...
0
votes
1answer
15 views
javax.naming.NoInitialContextException with mysql DataSource
Trying to connect to a MySQL database
MysqlDataSource mysqlDs = new MysqlDataSource();
Properties prop = new Properties();
String mysqlDataSourceDriver = ...
1
vote
1answer
36 views
Implement Connection pooling in JDBC using apache dbcp
Is this Good Code to implement pooling? I want to implement this in my project which has 30 threads operating concurrently and each thread requires more than four connection for each request? Does ...
5
votes
5answers
76 views
How to insert and select from mysql simultaneously
I have a requirement where I need to insert mobile number in mysql if and only if the number is is not present.So for this I am first checking if a number is present in mysql using select query .If ...
0
votes
1answer
27 views
how to write Mysql query to get data from database based on date?
My Database table is::
attendence date admission number attendence
2013-10-2 LSTM-0008/2013-2014 present
2013-10-19 LSTM-0008/2013-2014 absent
2013-10-20 ...
0
votes
3answers
77 views
Parsing and converting Datetime format from csv file to mysql in Java
I have a csv file in which the Datetime column is defined in "DD-MM-YYYY HH:MM" format. But the problem is MySQL accepts Datetime type as "YYYY-MM-DD HH:MM" only. I want to convert the format given in ...
0
votes
0answers
8 views
How to config OpenJPA encoding?
I'm having an issue with OpenJPA. I used it to persist values in MySQL DB. Amoung these values, there's a String value that has a spanish character (á). The data was persisted correctly, with the ...
0
votes
1answer
38 views
Not being able to connect to MySql database
I've had more problems with my database in the past: It could not always get connection. The database runs on a website (webhosting), and I try to access it from my own PC. Here things go wrong, if I ...
0
votes
1answer
45 views
Error Connection Null
I am trying to execute the following code, which connects my android application to mysql server through JDBC:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
...