0
votes
1answer
22 views

Hibernate-Mysql exception on a read loop

I got this exception during a select "get" query loop. session.get(Entity.class, id); Can you tell me how to avoid this? 2014-01-21 18:54:36 [WARN]SqlExceptionHelper:143 SQL Error: 0, SQLState: ...
0
votes
2answers
35 views

Java Database mySQL access denied

So I am trying to connect to my database and display an item from the table. The error I am getting is: SQL Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user ...
-1
votes
0answers
33 views

non-optimized regex and substr with injected list in mysql query [on hold]

edit: I can replace phone, -10 (that is last 10 digits of phone ) with full phone digits. on tip i got is SELECT….FROM… WHERE phone IN (…) UNION SELECT … FROM … WHERE email IN (…) edit end I am ...
0
votes
1answer
27 views

How do I escape the colon (:) in a mysql query over jdbc that contains a variable assignment?

I'm trying to run a query that involves a custom variable over JDBC toward a MySQL 5.0 database (Hibernate 4 as the ORM): SET @rownum := 0; SELECT rnum FROM ( SELECT (@rownum := @rownum + 1) AS ...
2
votes
1answer
29 views

HQL select from multiple tables

I have two tables/POJO's Person and Child that are relational via a String variable. I am getting this error: org.hibernate.exception.SQLGrammarException: could not extract ResultSet For this HQL ...
2
votes
1answer
11 views

Tools for debugging hibernate config

I get the below distinctly unhelpful stack trace when calling configureSessionFactory. I am assuming it cant find the driver, but it's there (I can import them in the same code). I've tried both ...
2
votes
1answer
45 views

Different database, different result type with 'SELECT 1' over jdbc: how to check the value?

I'm working on a project that uses JPA (Hibernate), so almost all the queries are written in JPQL. But for a query I need to get down to the specific database type, so I've written a native query. ...
0
votes
3answers
26 views

HQL String LEFT

How do I get records that first 4 characters' match my string using HQL? This is my HQL statement: Query query = HibernateUtil.getSessionFactory().getCurrentSession().createQuery("from User where ...
0
votes
3answers
25 views

how to create jpql with left outer join

I have for example 2 entities. A entity (Mysql Table name="A") B entity (Mysql Table name="B") I want fetch data from A table where it is not in the B table. I wrote sql and it is working. SELECT ...
-3
votes
2answers
36 views

Getting the max id in mysql using java

I just want to ask on how to get the maximum number of an VARCHAR ID for example; ID 2014-00001 2014-00002 2014-00006 2014-00003 how to get max of this column? and one more thing I also want to ...
0
votes
2answers
24 views

Java Netbeans MySql database Connection

I want to insert row into MySql database with a normal Program for Mysql connection in Java Netbeans,but when i run this code my database remains unaffected.I had setup connection with Netbeans and ...
0
votes
3answers
31 views

Save Data in blob from Java code

I am using below Java code to save data into a table ObjectInputStream ois = null; try { ois = new ObjectInputStream(new ByteArrayInputStream(string)); } catch (IOException e) { ...
0
votes
0answers
10 views

How to install JBPM 6 with MySQL Server

I have downloaded JBPM 6 installer and unzipped it. I want to use MySQL instead of H2 database. I have edited jbpm-persistence-JPA2.xml for MySQL and also added Mysql-Connector.jar. But during the ...
0
votes
1answer
23 views

database driven program in java, insert update delete in same jsp page

I am developing in java. I have a form in jsp page which adds details in database (MySql). I want to show all data in the jsp page below the form and it also should have facility to edit, delete, ...
1
vote
1answer
30 views

Return result from asynchronous SQL query (Java)

I am using MySQL to store data for a game I am making and need to access the database from outside the main thread so to not interupt it from a long query and return the data to the main thread to be ...
0
votes
1answer
30 views

Hibernate / SQLException: field doesn't have default value

mySQL Table generated using: CREATE TABLE `actors` ( `actorID` INT(11) NOT NULL, `actorName` VARCHAR(255) NOT NULL, PRIMARY KEY AUTO_INCREMENT (actorID) ); Mapped class: @Id ...
0
votes
2answers
24 views

Jsp, connection pool and mysql

I've going around this for a while, yet seem to be lacking the knowledge. Can someone paste a quick guide on how to implement such thing. I'm a bit puzzled about what context is and what's his role ...
-1
votes
0answers
19 views

Connecting to PHPmyadmin through android application for a login system

I`m trying to create a login system app for android with the help of MySQL phpmyadmin But when I want to register a new user the applications crashes. public class Register extends Activity ...
0
votes
1answer
33 views

java hibernate aggregation error

qty|price 1 | 4 4 | 5 6 | 4 2 | 3 1 | 2 are entries on the database. i am trying to get the result: (group quantity by price) qty|price 7 | 4 4 | 5 2 | 3 1 | 2 I am successful when i do this ...
1
vote
1answer
47 views

preparedStatement SQL Error

Here is my code: public int checklogin(String email, String key){ int res = -1; try { String selectSQL = "SELECT id FROM table WHERE email = ? AND key = ?"; PreparedStatement ...
1
vote
1answer
42 views

PHP MySQL and Android connection

I'm trying to connect my android app with an online database server that uses MySQL and phpMyAdmin. But problem I am having is that I'm unable to access my database (which is online) using Java code ...
0
votes
0answers
94 views

Java null exception

This is the design view where it got problem retrieving back Volunteer volunteer = Volunteer.Volunteer(); tf_fName = new JTextField(); tf_fName.setBounds(300, 113, 159, 20); ...
0
votes
0answers
14 views

How to add mysql connector to Sqoop 1.99.3

I have installed Hadoop & connected with Hadoop locally successful. I can connect the Sqoop via REST api and via cli interface. But once I want to start creating a job for important data from ...
0
votes
1answer
23 views

Block HTTP POST Request if a record already exists in the database

I am developing a Java Rest web service to store user data in a MYSQL database. When I test try POST with curl, I get 204 - No Content on the client side and ...
-5
votes
0answers
36 views

Unable to find online and ofline Status [on hold]

I got a task to create a chat app in a social Media. Which is the best way to find the users online and offline status. The app is for the http://doozyfive.com/ please any one help me. I tried it ...
0
votes
1answer
26 views

How to count XML tags of a document created with a servlet

I've created a servlet that use a class to convert the ResultSet of a mysql query in XML and return that XML to the browser. I can parse it correctly navigating with Javascript in the XML DOM but i ...
-3
votes
2answers
32 views

Store only date (without) time in database

How can I send date only from Java into MySQL Date data type, I can achieve that by saving string into database, but is there any better way? I am working on attendance of employees without time in ...
0
votes
1answer
50 views

Connecting JFrames with a variable

I have this program that is for a login form. I am trying to take user variable that is local in the actionListener method in order to use it in mysql database when the user answer a question. So ...
2
votes
1answer
35 views

Store byte array in MySQL from Java

I'm having trouble storing byte[] from a Java program in a MySQL database. I've got a Java method: public void newUser(User user) { Connection conn = pool.checkOut(); try { ...
0
votes
1answer
26 views

How to store and access large and frequently used data in XML?

I'm creating a forum website for my college project. Now just like the format of stackoverflow( ;) ), each question and answers will have comment facility. I'm expecting the size of questions and ...
0
votes
2answers
27 views

Java: Passing table name as parameter of prepared statement

I'm trying to learn how to use MySQL with Java and as the title says, I'm having problems with prepared statements. I have a MySQL table named temp which contains the values (output directly from ...
0
votes
1answer
34 views

java database connectivity: jdbc

i want to use the string input in textfield in JFrame form as a part of my sql query in java. For example if i input a name in textfield, i want the sql query to use that name and give the relevant ...
-1
votes
0answers
26 views

Best way to authenticate data coming from open source java plugin [on hold]

I have a question regarding the authentication of data coming from a open source java program. I have a website built on the CakePHP framework. I need the website to collect data on different ...
0
votes
0answers
16 views

How to implement Slope one without hadoop in Java?

I have a mysql database as describe in the on the slope one wikipedia page #My table ---------------------------------------- | id | itemID | userID | rating | ...
0
votes
0answers
15 views

InjectorJob: total number of urls injected after normalization and filtering: 0

I am having this: InjectorJob: total number of urls injected after normalization and filtering: 0 When I do: bin/nutch inject urls I am using nutch 2.2.1 with mysql. In the first time that I ...
0
votes
2answers
25 views

MySQLIntegrityConstraintViolationException - running DAO project

I created database and two tables for easy DAO program. DB is Mysql, and for creation I used terminal. Here is creation code for two tables: CREATE TABLE students ( id INT NOT NULL ...
-1
votes
3answers
38 views

sql syntax in java with string

I have this query( the parameters of the query are given by input: both table and name and password are string given by text field. //... ResultSet rs = st.executeQuery("select * " + ...
0
votes
3answers
25 views

Java sql read+write - prevent race condition?

I have two threads calling a method that performs a read and then a write of a record in a mysql database. Some pseudo code: public void incrementRowValue() { Connection conn = ...; try { ...
1
vote
2answers
19 views

Trigger Hibernate and Java App

I'm implementing a Java Application that does use of Hibernate for the DB management (mySQL 6.0) A table of my database has a column that stores the the date of a future day, like 09/09/2014. So, I'd ...
0
votes
1answer
15 views

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException Insert mysql error

This is the whole message I recieve: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version ...
0
votes
1answer
38 views

Syntax Error with mysql in java

I don' t understand why eclipse tell me this error for this query: ResultSet rs = st.executeQuery("select * from '"+ value3+ "' where Name='" + value1 + "' and Password='"+ value2 + "'"); error: ...
0
votes
2answers
35 views

Hibernate, one to many from different table to general table

Good day. Exists three tables(test): User (id, user_name) Object(id, object_name) Property(id, property_value) User, Object contain Property, so I'd like to use a special table ...
0
votes
2answers
35 views

Java + MySQL error on Query

I'm programming Java, and Eclipse is showing me this error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your ...
0
votes
1answer
44 views

JFreeChart - TimeSeries last 24 Hours

I have a Database which stores every 15 minutes the temperature. Now i want to create a Java JFreeChart time series Chart, which displays the last 24 hours. I imported the last 24 hours data with a ...
0
votes
2answers
39 views

How can I resolve this kind of error in jsp page?

How can I resolve this kind of error in jsp page? <%@ page import="javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <%@ page import="java.sql.*" %> k, i understand ...
1
vote
5answers
52 views

Why we call Class.forname(“com.mysql.jdbc.Driver”) even if mysql.jar is added in class path

Why we call Class.forname("com.mysql.jdbc.Driver") even if mysql.jar is added in class path .I think System ClassLoader should load this class as well if not then can any body describe how definition ...
0
votes
0answers
26 views

Can't get JTextField value to Database

In here NewJLabel is my Swing file and This is my main class to access everything and I need to get value from text field to database. This code compiles and runs but does not update in database. I ...
0
votes
1answer
27 views

java.lang.NullPointerException ( nutch 2.2.1 and MySql as datastore)

I am new in this area. I started with this tutorial:http://nlp.solutions.asia/?p=362#more-362. WHen i first crawled this url: nutch.apache.org, i had sucess, but when i tried a different url, i had ...
0
votes
3answers
25 views

Verifying ports are open

I'm trying to create a connection to a MySQL database hosted on a raspberrypi through a java program running on my computer. So far when I run my program I receive a communications link failure. As ...
1
vote
1answer
2k views

Howto resolve “Illegal mix of collations” SQLException?

I looked in the mysql reference, and here, in stackoverflow, and looks like a lot of people are having difficulties with character encoding, but I couldn't find a clear answer to this problem: A java ...

15 30 50 per page