Tagged Questions
0
votes
0answers
10 views
how to use sqlsession to update mysql
I want to update the mysql database in spring mybatis. I have couple of mapper interface and want to perform update using sqlsession.commit(). How can I define each of sqlsession?
@Transactional
...
0
votes
1answer
10 views
Java Applet with Mysql ExceptionInInitializerError
I'm using java applet with mysql connection. I used Netbeans to build paths. When my applet works in localhost, I got an error.
Exception in thread "Abandoned connection cleanup thread" ...
1
vote
0answers
18 views
DB service locator
100's of containers the service will be running.
Each container will be connecting to upto 50 data sources.
Highly regulated environment so the DB passwords will be reset once in 45 days.
High ...
0
votes
0answers
23 views
Designing an API between JDBC using SQL and Java [on hold]
Are there any good guides in designing an API between JDBC executing SQL commands to a MySQl Database and Java classes creating objects which represent what is actually stored in the Database and when ...
0
votes
1answer
20 views
Java Eclipse MySQLSyntaxErrorException
I'm trying to get some car lists from my database ,but somehow I keep getting this error com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Make' in 'field list'and I spent ...
0
votes
2answers
43 views
InputStream doesn't work
I'm new to jsp and I'm trying to create a simple page where the user uploads a photo to the database.
I used a upload.jsp page:
<%@ page language="java" contentType="text/html; ...
2
votes
5answers
47 views
Cant connect to my SQL database
So I'm having an issue connecting to MySQL with Java.
Heres my code:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class DBAccess {
private ...
2
votes
2answers
39 views
how can get records from three tables using join in hibernate?
I used this command in mysql and retrieved my records easily, but I am unable to do it in Java.
Please advice.
select * from table1
LEFT JOIN table2 ON table1.FRID=table2.FRID
LEFT JOIN ...
1
vote
1answer
21 views
Connect to MySQL using JDBC driver through a proxy
In Java, I would like to make a connection to a MySQL server which is on the web from a client computer that is behind a http proxy. I have read few solutions some say http tunnelling might work and ...
0
votes
1answer
28 views
Open Outgoing Port (CENTOS)
When doing a remote MySQl Connection from a linux node to a webserver (in a Java program), it cannot be accessed. I receive the error shown below. I can do MySQL Connections fine from my local ...
0
votes
2answers
46 views
Connecting to MySQL database java
I'm using some code for multi threaded MySQL system. It's working fine and will put entry's into my database in under half a second. My problem is, the rate at which my program will successfully ...
0
votes
0answers
20 views
Insert data to database from jtable [on hold]
i was writing code to insert data from jtable to database. my code is work but its only 1 column (the last one) inserted. heres my code
private void input(){
try{
Connection con = ...
0
votes
1answer
21 views
stuck in creating query to fetch the result from database?
i am creating a project called discussion forum in servlets...
but i stuck in the query to fetch the result from database with respect to the given topic...
i make a servlet named index in ...
0
votes
1answer
38 views
Data not updated after commiting the transaction
I'm using Jpa to manipulate a mysql database;
I bind every boolean property to checkbox, so that when i check/uncheck it, the state of the property will change..
An idea how my application looks ...
2
votes
1answer
38 views
Concept design for a MMO java engine
We are building a HTML5 MMO that will leverage AJAX calls to a REST API written in Python for actions ( buy, sell, build, trade, send , attack).
Our second part of this project is a Java Server that ...
0
votes
2answers
17 views
Java Servlet & MySQL
What's wrong with this code? It gives me "brand" = null.
public String getBrand(@WebParam(name = "regNr") String regNr) throws SQLException {
String brand=null;
Connection con;
Statement ...
0
votes
1answer
20 views
How Can I insert some data while using JTA Entity Manager
I'm using JBoss 7.1 AS in my application , JPA, Hibernate and MySql DB, I configured everything well and my program is fetching data from db normal. The problem is when I try to insert some data . I ...
0
votes
1answer
21 views
Inserting mysql entry if doesn't exist, updating if it does exist java
I'm wanting to insert an entry if it does not exist otherwise update the entry, I couldn't use the ON DUPLICATE KEY UPDATE, I got confused with the syntax. So I tried to do something like this:
...
-1
votes
1answer
23 views
Access denied for root@localhost to execute .jar file
Im trying to run a java client/server chatting project.
http://undergroundim.net/download.php?p=1
http://undergroundim.net/how_to.php?p=9
which has .exe file.
After running .exe file it ask for ...
-2
votes
0answers
28 views
forlooping through a mysql database with a java sql statement
I have a database with the column task situations.
The column stores int variable:
0= task not done,
1= busy with task,
2= task completed
I want to query in my java class through the task ...
1
vote
2answers
56 views
How to use inner join statement with Hibernate
I have two tables in a MySQL database:
1. Device table with some device specific values.
2. Vendor table with only a id value and name value
Now, I would like to get two values, model name and the ...
0
votes
1answer
16 views
JPA eclipse link Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException
I want to persist entity object to database that contain some null values and one of the null value is a foregin key of another table that i have to fill it later and here is the sessionbean
/*
...
-1
votes
2answers
49 views
What am I doing wrong in inserting data to mysql table?
After executing code I get the Data saved message but no data is recorded in my clients table? I'm new to databases with Java, What am I doing wrong or how can I fix my code?
String sqlUrl = ...
-2
votes
0answers
32 views
On-line database accessed from an Android application [on hold]
I'm developing an android application (road traffic system) and I would like to store the data in an on-line database, so different users can view this data. What exactly should I use? (I'm using ...
-2
votes
0answers
25 views
soap web service client using jsf and richfaces [on hold]
recently i created a soap web service to insert user registration information into mysql database. i created a consumer for that application using jsf and rich faces for client interaction... i ...
0
votes
0answers
14 views
Unable to start activity ComponentInfo{com.testes/com.testes.View_data}: android.os.NetworkOnMainThreadException [duplicate]
There is no error on my code but when I run the android application the logcats shows:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.testes/com.testes.MainActivity}: ...
0
votes
1answer
18 views
JPA join tables through query
I have strange problem. I want to create database like this:
One student can has a lot of subjects. Student has one evaluation for one subject. So I have
class student with ID, Name, Surname and A_I ...
0
votes
2answers
22 views
Set max-connections on MysqlConnectionPoolDataSource
I use MysqlConnectionPoolDataSource. I had to migrate from jndi definitions to a custom solution.
The old definition looks like :
<data-source ...
-2
votes
0answers
19 views
What shall be the backend for the event scheduler app [on hold]
I am working on a project which has two user interfaces and I have to schedule an event.
1st user provides 'city' and 'date' and 'subjects'
2nd user also provides 'prefered city' and 'date' and 'area ...
-5
votes
0answers
37 views
Guidance needed to get started with the project [on hold]
I have to do a university project wherein i need to get inputs from colleges and professors of various colleges. The inputs from colleges that are to be taken are ...
0
votes
1answer
46 views
Java set difference, may I use java object or database?
I need to get the difference between two set of integers (record ids). The first set is stored in text file, the second set is stored in mysql database.
I have two options:
1- Read all ids from ...
0
votes
3answers
60 views
Start Date and End Date Query not working
Following is the Requirement
If the search date range is 5/15/2013 to 5/21/2013, then events with the following event date ranges would be included or excluded:
1/01/2013 to 6/30/2013 include
...
-1
votes
1answer
40 views
remote DB connection via JDBC and mysql
I got the below error when i try to connect remote database
I use mysql server 5.5,installed all jar files and ran grant previlidge scripts also,
Pls help me to resolve the same
...
0
votes
0answers
30 views
Display blob image from database into jlabel
public void displayPhoto() {
rs = null;
String displaySQL = "select * from images where USERNAME ='" + temp.getUsername() + "'";
try {
con = getDBConnection();
rs = ...
5
votes
4answers
46 views
upload csv file containing million values to a particular column in mysql
Database: MySQL
CSV file having around million records like the following:
234546,345674,464368,563236,684269,707853,...
Data should get added into db in following manner:
id|number|status| ...
...
0
votes
0answers
20 views
RFID TagID saving into SQL using Java program
My question is in this code i am unable to install save the rfid tag id into my database basically this code is just sending the variable into the database and not the rfid tagID which is a ...
0
votes
2answers
75 views
switching databases in spring petclinic
I am trying to switch from hsql to MySQL in the spring petclinic sample application. Can someone show me what I am doing wrong?
I followed the instructions in the petclinic_db_setup_mysql.txt file, ...
0
votes
1answer
38 views
Unable to link Java program to SQL database
I've been attempting to implement a JDBC based database connection in my Java program to any database management systems. First I tried using Microsoft SQL Server Management Studio, my code looked ...
1
vote
1answer
35 views
Error when trying to save multiples records in Hibernate
When I try to save multiples records in my database I verify before if exist one record like that with this function.
public boolean hasNotaFiscal(Pojo pojo) {
String sql = "SELECT ...
0
votes
0answers
56 views
Searching database using seconds from Time
In my database table I have a column with Time data, with a HH:MM:SS format, that contains the following type of data (the data type is time):
12:12:02
12:12:03
12:12:05...
12:13:01...
I need to ...
0
votes
0answers
41 views
Mysql error on INSERT Unknown column in 'field list'
Hi I'm having an error using MySQL in Java. I keep getting this unknown column error everytime I try to insert into my table (when I run "testOne" below).
public static void sendMessage(String ...
0
votes
2answers
36 views
Java Cannot Connect to MySQL Server
I am trying to write a program in Java that in order to work, needs to have access to a MySQL database. Below is the code for the program so far, with the I.P. address, username, and password removed ...
0
votes
1answer
8 views
Connect Android / MySQL with JDBC
I have an application that try to connect to MySQL with JDBC by the following code in the MainActivity
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle ...
0
votes
3answers
23 views
Connecting to MySQL Database from java in IDE Netbeans
So this is my thing. I am trying to connect do MySQL Database from java. I have downloaded connector driver from MySQL ( Its called "mysql-connector-java-5.0.8-bin.jar" ) and I added to my libraries ...
0
votes
2answers
36 views
Is there any way to merge columns from multiple table to single list?
I have gathered records from 3 different tables using common key i.e common column for three tables and stored in 3 lists per,deg,deg.
Query query2 = s.createQuery("from StuPersonal where FRID = ...
-2
votes
1answer
34 views
How to access mysql data through java by using IP address as Host name?
String name = "";
String port = "3306";
String user = "root";
String pass = "";
String dbname = "atm";
String host="192.168.5.219"; // my local host ip address
// I want ...
0
votes
1answer
14 views
Hibernate Reset (Start PK from 0) using Code
I have a table that fills every day by some batch process.
I delete all the records and add new records through program using hibernate.
But in this case my ID (Auto increment PK) +1 every time.
I ...
-1
votes
2answers
46 views
getDateTime doesn't exist - what to use instead?
I have this problem that I have used DateTime from Joda and when I try to getDateTime it of course won't work because ResultSet doesn't have the method. What should I use instead?
I asked a similar ...
-3
votes
0answers
21 views
how to populate a jtable from a mysql database [on hold]
I am just starting Java and I have a quetions.
What is the simpelest way( I mean as simple as it can be) to populate a JTable with data from a mysql database?
thanks guys!
0
votes
1answer
33 views
Unable to import mysql table to hadoop using sqoop
I am trying to import table from mysql table using sqoop, but I am getting error no database found.
While running the following command:
sqoop import --connect jdbc:mysql://localhost/EOD --username ...