I have a MySQL database behind a firewall which can only be accessed via an SSH connection. Does anyone know of an implementation of java.sql.Connection which would allow me to make ... |
Would a LINQ for java be a useful tool? I have been working on a tool that will allow a Java object to map to a row in a database. ... |
I'm writing java application that is using both SQLite and MySQL using JDBC.
Are there any differences in SQL for those databases? Can I use same queries for both SQLite and MySQL, ... |
In Mysql there is a compare operator that is a null safe: <=>. I use this in my Java program when creating prepared statements like this:
String routerAddress = getSomeValue();
String sql = ...
|
i will use a query like this in ejb ql:
Select * from whe A&1;
But i have the following error:
line 1, column 171: unexpected char [&].
How can i use this operator to ... |
I am starting to use MySQL with JDBC.
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql:///x", "x", "x");
stmt = conn.createStatement();
stmt.execute( "CREATE TABLE amigos" +
"("+
...
|
The PROBLEM
I have a query like this:
select a.id from a join b on ( a.id = b.my_a ) join ....
where
( /* complex and expensive conditional */ ...
|
|
Something that has been puzzling me for a bit now, and an hour or two of googlin' hasn't really revealed any useful answers on the subject, so I figured I'd just ... |
i have a java program that is calling a Mysql stored procedure that is rolling back when it gets an SQLException. When i added the rollback (exit handler) to the ... |
I want to insert 50 000 records into MySQL through a web service written in Java but only 20 000 records are getting inserted.
I dont think there is size (number of ... |
I need to get data from an XML file and store it into a MySQL Database. I am thinking of using a SAX Parser for parsing the data but I am ... |
This is another debated subject, but this time i am searching only for the simple and documented answers. The scenario :
Let's assume the following method:
public static Hashtable<Long, ...
|
I have created a java application which stores data into MySQL database.
For that I have done the following things:
- I have installed MySQL database on my computer.
- I have created a database on ...
|
I've been writing a Library management Java app lately, and, up until now, the main Library database is stored in a .txt file which was later converted to ArrayList in Java ... |
i am creating a csv by using "INTO OUTFILE" statement for a mysql database. the database is huge 0.4 million records. i am using java program from eclipse to connect to ... |
Here goes a SQL-Java coding style question...
How do others here deal with creating complex custom queries in Java cleanly?
I am speaking of the seemingly simple task of preparing a string which ... |
In MySQL I can easily set the default value of a timestamp field to be the current time
fieldname timestamp not null default current_timestamp
Does anyone know how to do the same thing ... |
I am attempting to add an "export to CSV" feature to a webapp that displays data from a MySQL database. I have a written a "queryExecuter" class to execute queries ... |
I have a classifieds website, with approx 30 categories of classifieds.
I am on the stage where I have to build MySQL tables and index them with SOLR.
Each row in a table ... |
I am programming a WebService in Java that create and call this class :
public class Manager{
private Connection aConnection;
...
|
I have a classifieds website which uses SOLR to search for whatever ads the user wants to search for... SOLR then returns the ID:s of all the matches found. I then ... |
I have a table in mySQL and has 3 line which has name ,address,Telephone,Age,Charge. in two of them the names are "Adam" and the last row is "Abas" ,i don't know ... |
my friend wants from me to write two queries for him but really I don't know ,would you please help me?
also there is a table with two column (String Telephone and ... |
I am reading about SOLR and indexing a MySQL database into SOLR.
What do they mean by "tokenize" and "un-tokenize"?
And what does it mean when fields are "normalized"?
I know how and what ... |
I'm writing a desktop java app on that I want to connect to a MySQL database on a server. Here is the code to do that:
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
private static ...
|
I have a classifieds website, and users may for example search for cars.
When searching for a car, there are a number of endings in their names as you all probably know.
For ... |
I have a classifieds website.
Users may put ads, edit ads, view ads etc.
Whenever a user puts an ad, I am adding a document to solr.
I don't know however when to commit ... |
I have a simple web application written in java which has servlets accessing the Mysql Database to generate reports. The report generation happens very frequently.
I am using the apache commons ... |
I had completed my project Address Book in Java core, in which my data is stored in database (MySql).
I am facing a problem that when i run my program on other ... |
I'm writing a project that will make use of mySQL or Derby (it must work in both situations). To solve this I'm using Hibernate and it works nicely, but for a ... |
i have installed open cms on my local machine and it perfectly works fine.
But in order to work it corre,ty it is mentioned that i have to modify the my.ini file ... |
I'm working on a shortest path a* algorithm in java with a mysql db. I'm executing the following SQL Query approx 300 times in the program to find route connections from ... |
hi
I have a aggregate column present the microsecond, a report(with jasper) have to show HH:mm:ss of this indicator
What I did is using SEC_TO_TIME(sum(col)/1000) , but when mapping to java.sql.Time, i ... |
I have to get the median, mode and range of test scores from one column in a table but I am unsure how to go about doing that. When you connect ... |
I have Java Map (out of Strings and Ints) objects that I want to save to a database.
Is there a standard way to go about this task?
Is there a way ... |
I want to retrieve the most recently updated value in the table using an insert query.
these are the datatypes in my sql table.
int(11) // primary key auto increment, not being assigned ...
|
@WebMethod(operationName = "SearchOR")
public SearchOR getSearchOR (@WebParam(name = "comp")
String comp, @WebParam(name = "name")
String name) {
...
|
I'm struggling with getting the result OUT variable from a MySQL stored procedure. I get the following error:
java.sql.SQLException: Parameter number 3 is not an OUT parameter
The stored procedure looks like this:
CREATE ...
|
my table is:
[tableAbc]
A B C
------------
1 a b
2 c e
3 e r
...
run:
show create table tableAbc;
to get the create table sql
but how to get insert sql?
like:
insert into `tableAbc` ('A','B','C') VALUES(1,'a','b');
...
any idea? (or ... |
Microsoft provided us a way to create our own profiler by using Microsft.* namespaces. I can trace all queries going to any MS SQL instance. I need to do this on ... |
Hey Im working on a folder tree and need to be able to limit the visibility of certain folder based on the user and the group they belong to. I already ... |
I use Java to do some SQL queries.
in general the queries that i want to perform are:
set @uid=?; set @friendsList=?; IF EXISTS(select 1 from fb_user_friends join fb_user on " +
...
|
I currently need to execute a database query that involves data from three separate tables.
(bases,member,sell_transaction)
The bases table looks like the following
base_id(PK) name state
The member table looks like the following
id(PK) last_name username email first_name
The sell_transaction table has the ... |
I wonder how to backup (dump) a Solr database?
If it is only to copy some files, then please specify which files (filename, location etc).
Thanks
|
I have a small program that manually creates queries. In pseudo code, it's basically done like this
string[] a = new string[x];
a[0] = "data 1";
a[1] = "data 2";
a[2] = "data 3";
string query ... |
So presumably mysqldump can export to ansi compatible format so that you can import to other vendors' databases.
However trying to import to an apache derby I face ... |
how can I do the analogous to SELECT EXTRACT(EPOCH FROM TIMESTAMP '2001-02-16 20:38:40') in PostgreSQL, but in JDBC?
thanks
|
i am using mysql.
this query is working fine:
SELECT * FROM tablename where Date >'20091109' and id='11';
but below this query does not return any thing.
SELECT * FROM tablename where Date between ('20091109' ... |
Lets say I have a large number of threads inserting into a mysql database using Java.sql. After i perform an insert i would like to know the primary key of ... |
Is there anything built into Ibatis that helps prevent SQL Injection attacks? I'm not looking for a list of ways outside of Ibatis to do this, and am just wondering if ... |
I am attempting to get a connection to my University's MySQL DB but the connection is hanging.
import java.sql.*;
public class ConnectToDB {
public ...
|
SQL statement is not executedcom.mysql.jdbc.CommunicationsException: Communications link >failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.ConnectException MESSAGE:
Connection ... |
The following query is in SQL:
SELECT r.reservation_no, f.flight_no, r.departure_date,
f.departure_time, f.duration
FROM flights f, reservations r
WHERE f.flight_no=r.flight_no AND r.customer_ssn="234567";
Print the results to ... |
I'm using embedded SQL with Java. I have a simple table where I want to return an average from the column that contains temperatures. I tried to use ResultSet but it ... |
I have the followiing situation: I have a java code which is connected with a database (MySQL). When i am running the java code from eclipse and taking data from database, ... |
I'm writing a Java tool to validate SQL statements. For SELECT queries, I can do it with Connection.prepareStatement and PreparedStatemet.getMetaData. No exceptions == good query. Unfourtunately it doesn't work with eg. ... |
how to backup and restore my mysql database through java program
|
I have set up mysql database to run with java and eclipse on my Mac, it is running great, but now I will generate aprox 4.3billion rows of data which will ... |
I'm working a minimal game with Java and mysql. I encountered some difficulties with how to design my tables correctly. I need some advices: Let me be specific, I have 3 ... |
I'm trying to optimize the process of inserting a large number of results to a remote mySQL database. I'm using simple jdbc for that.
Currently I'm replacing exiting statements with PreparedStatement ... |
I have a prepared statement as so:
private static final String SQL_LIST_GROUP = "SELECT *
...
|
Since I'm not really proficient with databases, some details may be irrlevant, but I'll include everything:
As part of a project in my University, we're creating a website that uses JSP, servlets ... |
I have a database, which I query, and I'm unsure of where to perform the sorting of the results, so far I've have the following options.
- At the MySQL query.
- At list level(Using ...
|
The title says it all. I'm using JDBC directly, no Hibernate or ORM layer, and I want to search a table for multiple product names at the same time via "SELECT ... |
I have a locally installed MySQL server on my laptop, and I want to use the information in it for a unit-test, so I want to create a script to generate ... |
Here's how I'm trying to connect:
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception e) {
throw new DbConnectionException();
}
try ...
|
I'd like to know how to create my own callback for a SqlMapClientTemplate. Specifically so I can do batch calls.
|
Slowly building a starter changeSet xml file for one of three of my employer's primary schema's. The only show stopper has been incorporating the sizable library of MySQL stored procedures ... |
I'm running some simple MYSQL statements from within a Java application. I'm getting a syntax error on a statement that seems to run fine if I run it directly against the ... |
I'm trying all I can to get a JDBC to work, the only thing that is stumping me right now is this exception, which I have no idea about:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have ...
|
The code that sparked this question was a Service in my company's code base that contained four different DAO's. I didn't think much of this until I saw that this Service ... |
I've created a web service to connect my android device to a mysql database. I made the web service in java using eclipse galileo. I know the web service is working ... |
Good afternoon, i'm attempting to use a prepared statement to select a value from an SQL database.
My input, is an ID in the table Notification. I get an ID, because of ... |
I'm trying to delete an event from my table. However I can't seem to get it to work.
My SQL statement is:
public void deleteEvent(String eventName){
String query ...
|
I am getting a SQL exception "no value for parameter 3", I print all the value on the console. Why does it throw an exception?
String update="select * from net_cr_dr where (soc_code=? ...
|
I want to create Sql statement that show the ten first contacts that I have recieved message from along with their latest sent message and time. The table columns is messageId, ... |
I am trying to use JDBC to connect to a mysql database on our school's server. Here is my code:
try
{
...
|
I have a follow up to complicated mysql question that I recently asked: Show the ten first contacts that I have recieved message
Now I know that it is missing something, ... |
I have 20 factory machines all processing tasks. I have a database adapter that talks to a MYSQL database that the machines store all their info in. Is it safe to ... |
In my project I have to create insert statements based on the tables passed.
So I have two options
1)Write preparedstatement and run it in batch
2)Create insert into table values(..),(..),(..)
I want to ... |
I want to know if this delete statement has actually deleted something. The code below always execute the else. Whether it has deleted something or not. What's the proper way ... |
Well writing a login checker for a game, and switching from C# to java. Problem is I am using older code as an exmaple but keep running into this problem with ... |
Pretty much writing a launcher for a game and I need to take text from the Username text box, and a password textbox and then fetch the data from mysql server. ... |
I just want to test how to implement a timeout reset to a mysql server caused by an internet connection timeout. Therefore I have this little bit of code.
public static void ...
|
I know I've read the easy way of sanitizing user input into a database with Java is using PreparedStatement. But I was wondering if there was another way to sanitize user ... |
I've only learned Java last quarter of 2010. I can say the knowledge I gained as of now are not enough and there's a lot of improvement. I still do studying ... |
I have written a webapplication for payroll system which can do (insert,update,delete) to mysql database.
I want to know
how many transaction happened in mysql database ?
how many transaction happened ... |
I'm looking for a way to get the password from a java.sql.Connection object. I know there's a getUserName() method in the DatabaseMetaData object, but unfortunately no corresponding getPassword() method. ... |
Hey I made an EJB program and I created entity classes form my SQL database. Everything worked fine and it can connect to my database, but I get this error now ... |
Hi all
I'm having some small trouble trying to dynamicall generate an SQL SELECT statement generated from an entry from a webpage.
Basically i have a small search engine in the website, it ... |
I need use sql without working with mysql. Just from java create account, databases, export and import databases. Its possible? Or I shoult prefer XML for it?
|
I am starting to use Mahout for clustering, but I am having a hard time trying to convert a sql(mysql) dump to a mahout-compatible SequenceFile. I am using the code above. ... |
i.e, can we just use stored procedures for everything? In a web-site backed by a DB that is.
|
when this exception come for SQL
java.lang.IncompatibleClassChangeError: Found class com.mysql.jdbc.Statement, but interface was expected
Can you please explain ? does it come due to mysql jar changes to next version ?
... |
I have method:
@Override
public Group getGroupByStudentId(Long studentId) throws SQLException {
// TODO Auto-generated method stub
Group gr = null;
String query = "SELECT `group`.idgroup,
...
|
This is driving me nuts... What am I doing wrong here?
ArrayList<String> toAdd = new ArrayList<String>();
toAdd.add("password");
try{
PreparedStatement pStmt = conn.prepareStatement("ALTER TABLE testTable ADD ? varchar(100)");
...
|
I use com.mysql.jdbc.Driver
I need insert and get id.
My query:
INSERT INTO Sessions(id_user) VALUES(1);
SELECT LAST_INSERT_ID() FROM Sessions LIMIT 1;
error -
Can not issue data manipulation
statements with executeQuery()
How insert and ... |
So I have ~10 million records in an excel file that have to be parsed out in a specific way (I can't just convert to CSV and insert it like that) ... |
package javaapplication1;
import java.sql.*;
public class JavaApplication1{
public static void main(String[] args) {
System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/TEST/ANKUR1";
String dbName = "jdbctutorial";
...
|
Does the term 'embedded database' carry different meaning from 'database'?
|