Quantcast
Channel: MySQL Forums - Connector/J, JDBC and Java
Viewing all 884 articles
Browse latest View live

JAVA mysql Xampp (no replies)

$
0
0
Hello,

I have written a java web application and am trying to deploy it to a server which has mysql installed via XAMPP, the current installation is the database used for a Joomla application we have running. The hope is to have both of these applications running on the same server pointing to the same database.

I know that the ports are open since the current joomla application can connect to it, I can also connect to the database from my local machine and run the application. The problem I'm facing is deploying the application on the same server and connecting. I'm receiving the 'Access denied for user 'root'@'localhost' (using password: YES) ' error message no matter what user I have set in the connection string, its almost as if my config file is never being read and access is being blocked.

Server: MySQL
Version: 5.1.33-community
URL- Connection String:
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
<property name="url"><value>jdbc:mysql://127.0.0.1:3306/test</value></property>
<property name="username"><value>root</value></property>
<property name="password"><value>testpw</value></property>
<property name="initialSize" value="3"/>
<property name="maxActive" value="50"/>
</bean>

the root user has access to both localhost and 127.0.0.1 and the password is properly set. Does anyone have any idea what needs to be changed in order to get my application to connect to the database while the code is on the same machine? Thank you in advance!!

How to take away SELECT DATABASE() query from Connection.prepareCall() (2 replies)

$
0
0
Hello!
Does anybody know how to take away SELECT DATABASE() query from the method Connection.prepareCall().
There is no need of it. And it affects the performance.
I'm using mysql-connector-java-5.1.17 driver on windows
Thank you in advance!
Alex

Does rewriteBatchedStatements rewrite into prepared statements or regular ones? (1 reply)

$
0
0
Hi!
I'm working with mysql and java and use rewriteBatchedStatements in some cases.
My question is, when a batched statement is rewritten, does the connector use a new client-side prepared statement for the new statement generated from the batch? Or this new statement just has all the info inside it (instead of using placeholders for params) and is directly executed without preparing it?
If it's a prepared statement, then I have two doubts:
- Does it use ? placeholders for params or it inlines data?
- Is this prepared statement cacheable? Will it be cached if cachePrepStmts=true?
Thanks!

Juan

Poor performance using ResultSet.TYPE_SCROLL_INSENSITIVE (3 replies)

$
0
0
Hi All,

I use to write my queries using ResultSet.TYPE_SCROLL_INSENSITIVE statements.
The reason is that it's easy to paginate the results and retrieve query length without retrieving all rows neither running two queries.
Also this method helps me in every database (or it was what i thank).

Here is an example of what I use to do:

----------------------------------------------------------
int start = 0; // start will be the first row to retrieve
int limit = 20; // limit is page size

String sql = "select * from table";
PreparedStatement stmt = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(limit);

rs = stmt.executeQuery();
if (rs.last()) {
// I can move to the last row and get query length
queryLength = rs.getRow();
rs.beforeFirst();
}
if (start != 0) {
// I can jump to whatever position i need without having to read all positions in the recordset
rs.absolute(start);
}

int i = 0;
// I can get only limit (pagesize) or go to the end of results
while (rs.next() && i++ < limit) {
// Here I initialize Transfer or Value Objects (the list of....)
}
----------------------------------------------------------

This peace of code performs the best on oracle, sqlserver and DB2 and is database independent (because I'm using jdbc standard methods).

The problem I have is that MySQL JConnector don't use fetchsize, instead it retrieves all rows allways
(unless you use FORWARD_ONLY, CONCUR_READ_ONLY and FetchSize(Integer.MIN_VALUE and i can't use them to achieve what I want)).
See ResultSet information at http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-implementation-notes.html.

then, there is any chance to get the submitted code to behave optimally with MySQL???
Any ideas (or I will have to change all my DAOs for MySQL using limit clause for pagination and count(*) for query length....)

thanks in advance,

allowMultiQueries and continueBatchOnError: can be used together? (1 reply)

$
0
0
Hi all,

when using allowMultiQueries connection property, the performance of our application increases significatively(using updateBatch operations: java and mysql on different machines). Because our application is a batch job, with millions of queries to process in a daily basis, if an error occurs, query that faulted must be logged and process continues. In order to achieve this behaviour, we are using the continueBatchOnError connection property.

The problem is when we use both properties together. The getUpdateCounts() operation (on BatchUpdateException exception class) returns Statement.EXECUTE_FAILED for all queries so no batch operation continues executing the rest of the queries.

Are both properties not compatible? If they are, is there any way to now the query which faulted?

Thanks in advance

unable to close resource exception (no replies)

$
0
0
Hi,

I see this exception every day when I access the database for the first time. I get a org.skife.jdbi.v2.exceptions.UnableToCloseResourceException: Unable to close Connection exception. After the first request, any subsequent requests can access the database without any trouble. I am not sure what might be causing the issue. I am using jdbi and mysql db. I can post some code if needed.

Thanks!

KeyUsage does not allow digital signature (no replies)

$
0
0
Hi !
Today I found a strange problem.I received a pair of certificates (client and server) to allow access to mysql.using certificates with the utility mysql (mysql - ssl-ca = cacert.pem - ssl-key = key.pem - ssl-cert = cert.pem-uuserssl-ppassword) the connection is successfully established .. . but if I use the same certificates with JDBC connector (using java application ) the connection fails with the exception -KeyUsage does not allow digital signatures- .

There someone that can help me to resolve the arcane ?

Thanks in advance.

Alex


Some informations:

JdbcURL = jdbc:mysql://127.0.0.1/testl?useSSL=true&
requireSSL=true&
clientCertificateKeyStoreUrl=file:///C:/Program Files/mysql/CertificatiTI/test/keystore&
clientCertificateKeyStoreType=JKS&
clientCertificateKeyStorePassword=123456&
trustCertificateKeyStoreUrl=file:///C:/Program Files/mysql/CertificatiTI/test/truststore&trustCertificateKeyStoreType=JKS&trustCertificateKeyStorePassword=123456


exception stack trace


com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 276 milliseconds ago.
The last packet sent successfully to the server was 274 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2214)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:781)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:284)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Test.main(Test.java:144)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 273 milliseconds ago.
The last packet sent successfully to the server was 271 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:104)
at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4545)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1330)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2142)
... 12 more
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.Validator
Exception: KeyUsage does not allow digital signatures
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(UnknownSource)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:89)
... 15 more
Caused by: sun.security.validator.ValidatorException: KeyUsage does not allow digital signatures
at sun.security.validator.EndEntityChecker.checkTLSServer(Unknown Source
)
at sun.security.validator.EndEntityChecker.check(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
... 24 more

Connection.prepareCall() has some unneeded commands (5 replies)

$
0
0
Hello!
I have one problem with Connection.prepareCall()

This method
callableStatement = connection.prepareCall("{ call SOME_PROCEDURE_NAME(?, ?, ?, ?, ?) }");
writes these logs:
...
1 Query /* mysql-connector-java-5.1.17 ( Revision: ${bzr.revision-id} ) */SELECT @@session.auto_increment_increment
1 Query SHOW COLLATION
1 Query SET NAMES latin1
1 Query SET character_set_results = NULL
1 Query SET autocommit=1
1 Query SELECT name, type, comment FROM mysql.proc WHERE name like 'SOME_PROCEDURE_NAME' and db <=> 'db_name' ORDER BY name
1 Query USE `db_name`
1 Query SELECT DATABASE()
1 Query USE `db_name`
1 Query SHOW CREATE PROCEDURE `db_name`.`SOME_PROCEDURE_NAME`
1 Query CALL SOME_PROCEDURE_NAME(null, null, 1, @com_mysql_jdbc_outparam_retval, @com_mysql_jdbc_outparam_errmes)
1 Query SELECT @com_mysql_jdbc_outparam_retval,@com_mysql_jdbc_outparam_err
...

Is there a way to set the driver or to do something to avoid some of these commends:
SELECT name, type, comment FROM mysql.proc WHERE name like 'SOME_PROCEDURE_NAME' and db <=> 'db_name' ORDER BY name
1 Query USE `db_name`
1 Query SELECT DATABASE()
1 Query USE `db_name`
1 Query SHOW CREATE PROCEDURE `db_name`.`SOME_PROCEDURE_NAME`

I have a lot of Connection.prepareCall() methods in my project. So, this is about perfomance

Thank You in advance!
Alex

[Java + MySQL] Problems outside the IDE (2 replies)

$
0
0
I tried to solve this problem on a Java forum, but after weeks of discussion they pointed me other solution - Try a MySQL Forum.

I'll try to explain my problem in few words.

My code works very well inside the IDE, but when I try to use it outside the ide (.jar file) it doesn't work, I got several SQL problems

I'll show the class that makes the connection to the database, the erros that I got and my tries to debug it. If you want to read all the discussion the link to the Java forum is http://www.java-forums.org/new-java/47946-mysql-jar-problems-outside-ide.html

ConnectionDataBase class
Inside the IDE (NetBeans 7.0) it works perfectly(and the message "Conectado com sucesso!"), but outside it I get a SQL Exception (and the message "Can't connect to the Database")

public class ConnectionDataBase {
	 
    private static final String URL_MYSQL = "jdbc:mysql://localhost:3306/hospital";
    private static final String DRIVER_CLASS = "com.mysql.jdbc.Driver";
    private static final String USER = "root";
    private static final String PASS = "lsa1234";

public static Connection getConnection() 
{
        System.out.println("Conectando ao Banco de Dados");
        
        try 
        {
            //Carrega o Driver do Banco
            Class.forName(DRIVER_CLASS);
            Connection conn = DriverManager.getConnection(URL_MYSQL, USER, PASS);
            if (conn != null) {

                System.out.println("STATUS--->Conectado com sucesso!");

            } else {

                System.out.println("STATUS--->Não foi possivel realizar conexão");

            }
            return conn;
            
        } 
        
        catch (ClassNotFoundException e) 
        {
            System.out.println("O driver expecificado nao foi encontrado.");
            e.printStackTrace();
        } 
        catch (SQLException e) 
        {
            System.out.println("Can't connect to the database.");
            throw new RuntimeException(e);

        }
        return null;
    }
}

These are the errors outside the IDE

]Exception in thread "main" java.lang.RuntimeException: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '????????????????' at line 1
at ConnectionDataBase.getConnection(ConnectionDataBase.java:48)
at GenericDao.<init>(GenericDao.java:19)
at DadosDao.<init>(DadosDao.java:17)
at DadosController.listaDados(DadosController.java:65)
at Principal.<init>(Principal.java:35)
at Cadastro.main(Cadastro.java:12)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '????????????????' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1049)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
at com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1881)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3496)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2385)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2154)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:792)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:377)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at java.sql.DriverManager.getConnection(libgcj.so.11)
at java.sql.DriverManager.getConnection(libgcj.so.11)
at ConnectionDataBase.getConnection(ConnectionDataBase.java:26)
...5 more

JDBC "call proc" fails where command line works (1 reply)

$
0
0
I am getting the error "procedure XXX can't return a result set in the given context" when calling a stored proc with Connector/J 5.1.18. The stored proc in question has one cursor, but no bare SELECT statements in it.

I can call the proc from the mysql command line client and it works as expected - the MySQL client and server are both version 5.1.47.

My Java code is:

CallableStatement s = connection.prepareCall("{call YYY(?, ?)}");
s.setString(1, "foo");
s.setString(2, "bar");
s.execute();

Proc YYY then calls proc XXX, and the execute() throws a SQLException with a 1312 error code.

Is there a MySQL session parameter or something I should be setting on the JDBC connection that would make it work like the mysql client?

Thanks,
Greg.

JspMyAdmin and squirrel SQL (no replies)

$
0
0
Hi all,

anyone knows wehere can I find the installation and configuration instructions for:
-jspMyAdmin and
-squirrel SQL?

Thank you

unable to close resource exception (2 replies)

$
0
0
Hi,

I see this exception every day when I access the database for the first time. I get a org.skife.jdbi.v2.exceptions.UnableToCloseResourceException: Unable to close Connection exception. After the first request, any subsequent requests can access the database without any trouble. I am not sure what might be causing the issue. I am using jdbi and mysql db. I can post some code if needed.

Thanks!

Issues with CF 9 and MySQL 5.5 (no replies)

$
0
0
I upgraded the version of Java and switched over to using ODBC data sources from ColdFusion and now MySQL 5.5 is acting funny. I don't know which thing I did is causing the issues, but now I'm noticing that in the following query I am required to escape the outfile slashes whereas I didn't have to before. What would cause this behavior to change? I'm running Win2008 R2 64-bit:

SELECT `ca_services`.`ca_service_id`, COALESCE(`ca_services`.`client_id`, ''),
COALESCE(TRIM(`caselink`.`ca_master`.`ss_number`), ''), COALESCE(`ca_services`.`service_id`, ''),
COALESCE(`caselink`.`ca_programs`.`prog_code`, ''), COALESCE(TRIM(`services_master`.`service_name`), ''),
COALESCE(TRIM(`organization`.`programs`.`prog_name`), '') AS `program`,
IF(
COALESCE(`ca_services`.`start_date`, '0000-00-00') <> '0000-00-00',
DATE_FORMAT(`ca_services`.`start_date`, '%m/%d/%Y'),
''
),
IF(
COALESCE(`ca_services`.`end_date`, '0000-00-00') <> '0000-00-00',
DATE_FORMAT(`ca_services`.`end_date`, '%m/%d/%Y'),
''
),
COALESCE(TRIM(`ca_services`.`dvr_authorization_number`), ''), COALESCE(TRIM(`services_master`.`ups_code`), ''),
COALESCE(`ca_services`.`approved_units`, ''), COALESCE(`services_master`.`rate`, ''),
COALESCE(`ca_services`.`budget_service_id`, ''), COALESCE(`ca_services`.`service_status_id`, ''),
COALESCE(`ca_services`.`discharge_reason_id`, '')
INTO OUTFILE 'D:\MySQL\Data\billing_temp_files\export_ca_services.txt'
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\r\n'
FROM `ca_services`
INNER JOIN `caselink`.`ca_master` USING (`client_id`)
INNER JOIN `caselink`.`ca_programs` USING (`prog_id`)
LEFT JOIN `organization`.`programs`
ON (`organization`.`programs`.`prog_code` = `caselink`.`ca_programs`.`prog_code`)
LEFT JOIN `services_master` USING (`service_id`)
WHERE (`ca_services`.`service_status_id` IN (5, 3, 7))
AND (`ca_services`.`ca_service_id` > 1)

Incorrect data from ResultSet (2 replies)

$
0
0
Hi, while I was doing a stress testing on our Mysql server, I was surprised that sometimes I am getting incorrect data and this is happening randomly, My select is: Select ID, DATE from LEDGER Where DATE >= '2011-09-23')

I was surprised to get a row from with date = 22/09/2011 00:00:00
but if I executed this select another time right after the old one I got the correct values where date >= '2011-09-23';

Note: I am using the latest mysql server 5.5.16, and latest connector/J version 5.1.18, and Innodb as our storage engine.

does anyone have an idea... thanks

not able to run stored procedures from java program (1 reply)

$
0
0
I'm writing a java application that communicates with a MySQL server. This server has a few stored procedures I need to call, but when I try to call them I get the following error:
User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with "noAccessToProcedureBodies=true" to have driver generate parameters that represent INOUT strings irregardless of actual parameter types.
SQL State:S1000
error code:0
I tried adding noAccessToProcedureBodies=true to the connection string, but it kept giving me the same error. I then proceeded to GRANT SELECT on mysql.proc, which should solve the problem, and since I have a user (creautenti) which is the user admin and creates all the others, i added with grant option to the statement, so that it would be able to grant the same privilege to the other users when creating them, but even if I call for each new user GRANT SELECT ON mysql.proc, it still won't work. I mean, when I log in as creautenti and call a procedure, it works just fine, but if I try to do it with any other user I get the error I wrote above. What's also strange is that I'm able to call the procedures from mysql workbench (logged in as any user I created through creautenti) even if I don't call grant select on mysql.proc, only with the execute privilege on the schema that contains the sprocs.
this is the method I call to create new users, which seems not to give the correct privileges:

public static boolean creazioneUtente(String user, String password) throws EccezioneDaMostrare{
if(apriConnessione(CREA_UTENTI_USER, CREA_UTENTI_PW, false)){
try{
conn.setAutoCommit(false);
String sqlCommand="CREATE USER ? @'%' IDENTIFIED BY PASSWORD ?";
String sqlCommandGrant="GRANT EXECUTE ON salvataggi.* TO ? ";
String sqlCommandGrantEx="GRANT SELECT ON mysql.proc TO ?";
PreparedStatement s=conn.prepareStatement(sqlCommand);
PreparedStatement sGrant=conn.prepareStatement(sqlCommandGrant);
PreparedStatement sGrantEx=conn.prepareStatement(sqlCommandGrantEx);
s.setString(1, user);
sGrant.setString(1, user);
sGrantEx.setString(1, user);
s.setString(2, mySQLPASSWORD(password));
s.execute();
sGrant.execute();
sGrantEx.execute();
conn.commit();
conn.setAutoCommit(true);
chiudiConnessione();
return true;
}
catch(SQLException e){
try {
conn.rollback();
} catch (SQLException e1) {
String msg=String.format("Errore durante la connessione al server MySQL:\n Messaggio:%s \n Stato SQL:%s \n Codice errore:%s", e.getMessage(), e.getSQLState(), e.getErrorCode());
throw new EccezioneDaMostrare(msg);
}
chiudiConnessione();
return false;
}
}
else
return false;
}

apriConnessione() opens a connection, and chiudiConnessione() closes it.

Can't Call a stored procedure in phpMyAdmin (no replies)

$
0
0
Hi,

I posted the below question on a phpMyAdmin form and was told it was a mySQL question so I was hoping somebody here might be able to help.

I have created some stored procedures in phpMyAdmin but I am having difficulty running them any help would be greatly appreciated.

Regards,
David.

DELIMITER ;;
DROP PROCEDURE IF EXISTS phpMyAdminSPTest ;;
CREATE PROCEDURE phpMyAdminSPTest ()
BEGIN
SELECT * FROM Details;
END ;;

------- Your SQL query has been executed successfully ----------

CALL phpMyAdminSPTest();

-----------------------------------------------------------------
Error SQL query:
CALL phpMyAdminSPTest( )
MySQL said: Documentation #1312 - PROCEDURE phpMyAdminSPTest can't return a result set in the given context

Mysql Watch Man City v Wolverhampton Enjoy Live Stream 29/10/2011 (no replies)

Connector MXJ beta state (no replies)

$
0
0
Hi,
In the documents, it is written that connector mxj is in beta state.
Is this still true?
(I want to use the commercial connector mxj in a commercial application and it is not acceptable for me to use a beta version.)

Thanks,
Doron

Watch Valencia v Bayer Leverkusen Enjoy Live Stream 01/11/2011 (no replies)

Cannot insert ONE Slovenian character (no replies)

$
0
0
Hello!
I've written a Java desktop application which accesses a MySQL 5.1 DB running on a different machine (Ubuntu server 10.04). Clients run on Ubuntu 10.10
The "customer" is Slovenian. The DB is therefore UTF-8 and I connect to it using JDBC (class org.gjt.mm.mysql.Driver) and specifying
useUnicode=true&characterEncoding=UTF-8
in the connection url.
Data is read and inserted using stored procedures. Textual fields are VARCHARs.

Problem: all Slovenian characters are managed correctly (both read and written) except for c with the caron (unicode c48d). Whenever I try to insert this character from my application I get the error from MySQL stating that bytes c4 and 8d cannot be written in the involved column of the involved table. If I try to insert the character from, say, Query Browser, and then retrieve it, all works fine, though. If I read and then try to write what I just read, I get the usual error when saving!

I tried everything and can't think of anything more.

I've tried connector versions 5.1.8 and 5.1.18.
Below are the relevant (I guess) server configuration sections:

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set=utf8
#character_set_results=utf8
#character_set_connection=utf8


[mysqld]

user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking

default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'

#character_set_server=utf8
#collation_server=utf8_unicode_ci


Here is the result of running SHOW VARIABLES (from Query Browser):

"Variable_name","Value"
"auto_increment_increment","1"
"auto_increment_offset","1"
"autocommit","ON"
"automatic_sp_privileges","ON"
"back_log","50"
"basedir","/usr/"
"big_tables","OFF"
"binlog_cache_size","32768"
"binlog_format","STATEMENT"
"bulk_insert_buffer_size","8388608"
"character_set_client","utf8"
"character_set_connection","utf8"
"character_set_database","utf8"
"character_set_filesystem","binary"
"character_set_results","utf8"
"character_set_server","utf8"
"character_set_system","utf8"
"character_sets_dir","/usr/share/mysql/charsets/"
"collation_connection","utf8_general_ci"
"collation_database","utf8_general_ci"
"collation_server","utf8_general_ci"
"completion_type","0"
"concurrent_insert","1"
"connect_timeout","10"
"datadir","/var/lib/mysql/"
"date_format","%Y-%m-%d"
"datetime_format","%Y-%m-%d %H:%i:%s"
"default_week_format","0"
"delay_key_write","ON"
"delayed_insert_limit","100"
"delayed_insert_timeout","300"
"delayed_queue_size","1000"
"div_precision_increment","4"
"engine_condition_pushdown","ON"
"error_count","0"
"event_scheduler","OFF"
"expire_logs_days","10"
"flush","OFF"
"flush_time","0"
"foreign_key_checks","ON"
"ft_boolean_syntax","+ -><()~*:""""&|"
"ft_max_word_len","84"
"ft_min_word_len","4"
"ft_query_expansion_limit","20"
"ft_stopword_file","(built-in)"
"general_log","OFF"
"general_log_file","/var/lib/mysql/bor-server.log"
"group_concat_max_len","1024"
"have_community_features","YES"
"have_compress","YES"
"have_crypt","YES"
"have_csv","YES"
"have_dynamic_loading","YES"
"have_geometry","YES"
"have_innodb","YES"
"have_ndbcluster","NO"
"have_openssl","DISABLED"
"have_partitioning","YES"
"have_query_cache","YES"
"have_rtree_keys","YES"
"have_ssl","DISABLED"
"have_symlink","YES"
"hostname","bor-server"
"identity","0"
"ignore_builtin_innodb","OFF"
"init_connect","SET NAMES utf8"
"init_file",""
"init_slave",""
"innodb_adaptive_hash_index","ON"
"innodb_additional_mem_pool_size","1048576"
"innodb_autoextend_increment","8"
"innodb_autoinc_lock_mode","1"
"innodb_buffer_pool_size","8388608"
"innodb_checksums","ON"
"innodb_commit_concurrency","0"
"innodb_concurrency_tickets","500"
"innodb_data_file_path","ibdata1:10M:autoextend"
"innodb_data_home_dir",""
"innodb_doublewrite","ON"
"innodb_fast_shutdown","1"
"innodb_file_io_threads","4"
"innodb_file_per_table","OFF"
"innodb_flush_log_at_trx_commit","1"
"innodb_flush_method",""
"innodb_force_recovery","0"
"innodb_lock_wait_timeout","50"
"innodb_locks_unsafe_for_binlog","OFF"
"innodb_log_buffer_size","1048576"
"innodb_log_file_size","5242880"
"innodb_log_files_in_group","2"
"innodb_log_group_home_dir","./"
"innodb_max_dirty_pages_pct","90"
"innodb_max_purge_lag","0"
"innodb_mirrored_log_groups","1"
"innodb_open_files","300"
"innodb_rollback_on_timeout","OFF"
"innodb_stats_on_metadata","ON"
"innodb_support_xa","ON"
"innodb_sync_spin_loops","20"
"innodb_table_locks","ON"
"innodb_thread_concurrency","8"
"innodb_thread_sleep_delay","10000"
"innodb_use_legacy_cardinality_algorithm","ON"
"insert_id","0"
"interactive_timeout","28800"
"join_buffer_size","131072"
"keep_files_on_create","OFF"
"key_buffer_size","16777216"
"key_cache_age_threshold","300"
"key_cache_block_size","1024"
"key_cache_division_limit","100"
"language","/usr/share/mysql/english/"
"large_files_support","ON"
"large_page_size","0"
"large_pages","OFF"
"last_insert_id","0"
"lc_time_names","en_US"
"license","GPL"
"local_infile","ON"
"locked_in_memory","OFF"
"log","OFF"
"log_bin","OFF"
"log_bin_trust_function_creators","OFF"
"log_bin_trust_routine_creators","OFF"
"log_error","/var/log/mysql/error.log"
"log_output","FILE"
"log_queries_not_using_indexes","OFF"
"log_slave_updates","OFF"
"log_slow_queries","OFF"
"log_warnings","1"
"long_query_time","10.000000"
"low_priority_updates","OFF"
"lower_case_file_system","OFF"
"lower_case_table_names","0"
"max_allowed_packet","16777216"
"max_binlog_cache_size","4294963200"
"max_binlog_size","104857600"
"max_connect_errors","10"
"max_connections","151"
"max_delayed_threads","20"
"max_error_count","64"
"max_heap_table_size","16777216"
"max_insert_delayed_threads","20"
"max_join_size","18446744073709551615"
"max_length_for_sort_data","1024"
"max_prepared_stmt_count","16382"
"max_relay_log_size","0"
"max_seeks_for_key","4294967295"
"max_sort_length","1024"
"max_sp_recursion_depth","0"
"max_tmp_tables","32"
"max_user_connections","0"
"max_write_lock_count","4294967295"
"min_examined_row_limit","0"
"multi_range_count","256"
"myisam_data_pointer_size","6"
"myisam_max_sort_file_size","2146435072"
"myisam_recover_options","BACKUP"
"myisam_repair_threads","1"
"myisam_sort_buffer_size","8388608"
"myisam_stats_method","nulls_unequal"
"myisam_use_mmap","OFF"
"net_buffer_length","16384"
"net_read_timeout","30"
"net_retry_count","10"
"net_write_timeout","60"
"new","OFF"
"old","OFF"
"old_alter_table","OFF"
"old_passwords","OFF"
"open_files_limit","1024"
"optimizer_prune_level","1"
"optimizer_search_depth","62"
"optimizer_switch","index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on"
"pid_file","/var/lib/mysql/bor-server.pid"
"plugin_dir","/usr/lib/mysql/plugin"
"port","3306"
"preload_buffer_size","32768"
"profiling","OFF"
"profiling_history_size","15"
"protocol_version","10"
"pseudo_thread_id","73"
"query_alloc_block_size","8192"
"query_cache_limit","1048576"
"query_cache_min_res_unit","4096"
"query_cache_size","16777216"
"query_cache_type","ON"
"query_cache_wlock_invalidate","OFF"
"query_prealloc_size","8192"
"rand_seed1",""
"rand_seed2",""
"range_alloc_block_size","4096"
"read_buffer_size","131072"
"read_only","OFF"
"read_rnd_buffer_size","262144"
"relay_log",""
"relay_log_index",""
"relay_log_info_file","relay-log.info"
"relay_log_purge","ON"
"relay_log_space_limit","0"
"report_host",""
"report_password",""
"report_port","3306"
"report_user",""
"rpl_recovery_rank","0"
"secure_auth","OFF"
"secure_file_priv",""
"server_id","0"
"skip_external_locking","ON"
"skip_networking","OFF"
"skip_show_database","OFF"
"slave_compressed_protocol","OFF"
"slave_exec_mode","STRICT"
"slave_load_tmpdir","/tmp"
"slave_net_timeout","3600"
"slave_skip_errors","OFF"
"slave_transaction_retries","10"
"slow_launch_time","2"
"slow_query_log","OFF"
"slow_query_log_file","/var/lib/mysql/bor-server-slow.log"
"socket","/var/run/mysqld/mysqld.sock"
"sort_buffer_size","2097144"
"sql_auto_is_null","ON"
"sql_big_selects","ON"
"sql_big_tables","OFF"
"sql_buffer_result","OFF"
"sql_log_bin","ON"
"sql_log_off","OFF"
"sql_log_update","ON"
"sql_low_priority_updates","OFF"
"sql_max_join_size","18446744073709551615"
"sql_mode",""
"sql_notes","ON"
"sql_quote_show_create","ON"
"sql_safe_updates","OFF"
"sql_select_limit","18446744073709551615"
"sql_slave_skip_counter",""
"sql_warnings","OFF"
"ssl_ca",""
"ssl_capath",""
"ssl_cert",""
"ssl_cipher",""
"ssl_key",""
"storage_engine","MyISAM"
"sync_binlog","0"
"sync_frm","ON"
"system_time_zone","CET"
"table_definition_cache","256"
"table_lock_wait_timeout","50"
"table_open_cache","64"
"table_type","MyISAM"
"thread_cache_size","8"
"thread_handling","one-thread-per-connection"
"thread_stack","196608"
"time_format","%H:%i:%s"
"time_zone","SYSTEM"
"timed_mutexes","OFF"
"timestamp","1320418940"
"tmp_table_size","16777216"
"tmpdir","/tmp"
"transaction_alloc_block_size","8192"
"transaction_prealloc_size","4096"
"tx_isolation","REPEATABLE-READ"
"unique_checks","ON"
"updatable_views_with_limit","YES"
"version","5.1.41-3ubuntu12.10"
"version_comment","(Ubuntu)"
"version_compile_machine","i486"
"version_compile_os","debian-linux-gnu"
"wait_timeout","28800"
"warning_count","0"

I really don't understand what's going on. Can anybody help me, please?
Thank you in advance!
Viewing all 884 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>