Programming :: Java Cannot Find Mysql Connector?
Jun 12, 2011
I'm trying to use MySQL's JDBC connector for java but even though I set the CLASSPATH variable, java cannot find the com.mysql.jdbc.Driver class.
Code:
[jordan@Jordan-Laptop java-stuff]$ ls /usr/share/java
cal10n geronimo-jta.jar java_cup-runtime.jar
[code]...
View 14 Replies
ADVERTISEMENT
Jan 18, 2010
I want to ask how i set Linux class path for mail.jar and mysql-connector.jar. I have set the class path for java with the command.
Code:
when i do java -version it's work fine.
Also if i want to know that what shell i am using how can i find it.Also what is the command for showing class path variables or how can i see my JAVA_HOME class path.Means after setting the class path for above two files how can i see that these files have added.
When i write echo $CLASSPATH or echo $JAVA_HOME it shows nothing no error but again shows the prompt.
One thing more i want to run a java program on Linux it is in a package (named asteriskproject). It consist of 10 java files. I have run this program on windows using netbeans IDE.For this program i need to set my Linux class path for the above mentioned files, and this is my first time that i am running any program on Linux. So i want to ask how can i run my program. Simply put this asteriskproject directory in any folder and run the main file using javac. Is it right way to run the program that consist of package ?
View 3 Replies
View Related
Jun 20, 2011
I installed Tomcat (apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples) and it runs without problems.
I installed MySQL (apt-get install mysql-server) and it seems to run without problems too.
I changed the default JRE (update-java-alternatives -s java-6-sun).
The weird thing is - if I put the connector-jar into my web application (WEB-INF/lib), the connection works. If I put the connector-jar into usr/share/java, it does not work. If I write the jar location into the CLASSPATH and try "java com.mysql.jdbc.Driver", I get a NoSuchMethodError:Main, which means, that the jar is found?!
The datasource in the tomcat context.xml is:
<Resource name="jdbc/myresource" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="username" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/myschema" />
How can I make the database connection work without putting the jar into the WEB-INF/lib folder of the web application?
View 2 Replies
View Related
Apr 6, 2016
I got assigned to a project, where the installation is done over ansible. As I'm new in linux, python, django, ansible I wanted to try this out on a empty linux debian.
Code: Select alluname -a
Linux DebianABC 3.16.0-4 amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86 64 Gnu/Linux
When I now run my ansible playbook it tries to install mysql and suddenly I get an error:
Code: Select all:stderr: DEPRECATION: --allow-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
Could not find a version that satisfies the requirement mysql-connector-python==1.0.12 (from -r /home/abc/abcTest/requirements.pip (line 36)) (from versions: )
No matching distribution found for mysql-connector-python==1.0.12 (from -r /home/abc/abcTest/requirements.pip (line 36))
FATAL: all hosts have already failed -- aborting
So I checked the target machine and tried to run
pip install -vvv -r requirement.txt mysql-connector-python
As version 1.0.12 is an old version, I was searching and tried the following: [URL] ....
But also if I run the installation by direct download I have the same error message:
Code: Select allabc@DebianABC:/home/abc/abcTest$ pip install -r requirements.pip -vvv mysql-connector-python
Collecting http://cdn.mysql.com//Downloads/Connector-Python/mysql-connector-python-1.0.12.tar.gz (from -r requirements.pip (line 36))
Starting new HTTP connection (1): cdn.mysql.com
"GET //Downloads/Connector-Python/mysql-connector-python-1.0.12.tar.gz HTTP/1.1" 200 230923
[Code] ....
I was reading about the version requirements from PEP: [URL] .... but as the version looks ok, this should not be the problem.
View 0 Replies
View Related
Sep 14, 2010
I use ubuntu lucid lynx, LAMP (mysql 5.1 and last php) and tried to install the package from mysql web page (mysql-connector-odbc-5.1.7-linux-glibc2.3-x86-32bit.tar.gz) through alien. Terminal output is as follows:p { margin-bottom: 0.21cm; }
sudo alien -d -c -k -i mysql-connector-odbc-5.1.7-linux-glibc2.3-x86-32bit.tar
dpkg --no-force-overwrite -i mysql-connector-odbc_5.1.7-1_all.deb
(Lendo banco de dados ... 147517 arquivos e diretios atualmente instalados).
[code]....
View 1 Replies
View Related
May 18, 2010
This is a bit of revision for the OU course M257
Code: Select all import java.util.*;
public class FindDupes {
public static void main(String[] args) {
Set<String> orig = new HashSet<String>();
Set<String> dupe = new HashSet<String>();
for(String a: args)
if(!orig.add(a))
dupe.add(a);
orig.removeAll(dupe);
System.out.println("words " + orig);
System.out.println("dudes " + dupe);
}
}
for some reason it will compile but not run on debian lenny complains it can't find the main class but it compiles and runs without problem on Fedora 12.
View 6 Replies
View Related
May 10, 2010
I found a program from :
Quote: url
with this source :
Quote:
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "mysql.h"
MYSQL *mysql;
MYSQL_RES *results;
code....
what is the problem?
View 6 Replies
View Related
Feb 2, 2011
What I am doing is reading the text from a text document and storing all of the text inside of a ArrayList. I then set one of the values of the Arraylist as a string. I want to use regular expressions find out what the first two characters of the String are. if first two characters = "//" then function(); I only care about the first two characters though. If you need any more information, just ask.
View 4 Replies
View Related
Apr 3, 2010
I'm trying to install snort-2.8.5.3 on centos5-i386 an I get this error from ./configure --with-mysql --enable-dynamicplugin command:
ERROR: unable to find mysql headers (mysql.h)
checked in the following places
/usr
/usr/include
[Code].....
I've read here it has to do with libmysqlclient12-dev. How can I install libmysqlclient12-dev on centOS?
Is it possible to install snort from repositories using yum?
View 3 Replies
View Related
Mar 30, 2009
I am trying to install php-mysql but I am getting conflicts. I manually installed
MySQL-shared-community-5.1.32-0.rhel5
MySQL-client-community-5.1.32-0.rhel5
MySQL-server-community-5.1.32-0.rhel5
and I can not seem to find a php-mysql that works with MySQL 5.1
I followed the below thread and added the CentOS-Testing.repo and did a yum update php and it updated 30 packages, but when I try to install php-mysql I get :
[URL]
yum install php-mysql
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
[Code].....
Where can I find a php-mysql that works with MySQL 5.1? I checked the mysql website and can not seem to find any matches.
View 4 Replies
View Related
Feb 24, 2011
due to some issues i uninstalled openjdk shipped default on my opensuse 11.3 and installed jdk 1_6_21 from a .bin file. Its installed to usr/java/jdk.The mysql connector is also present in the same but running a java program that connects to mysql gives me the errorjava.sql.SQLException: Unknown initial character set index '192' received from server. Initial client character set can be forced via the 'characterEncoding' property.the code i tried is
import java.sql.*;
import java.io.*;
class mysql_conn_tester
[code]...
View 3 Replies
View Related
Apr 22, 2011
I have installed open suse linux 11.3. I have mysql database and jdk 1.6.20.0. How do I connect from java to mysql database?
View 2 Replies
View Related
Feb 27, 2010
I want to learn Java programing language and MySQL in linux.What packages do I've to install?Are there any sites providing basic tutorials of java and MySQL?
View 1 Replies
View Related
Jul 2, 2009
I have recently installed Java in my Ubuntu 9.04 environment so that I can teach myself Java. Basic Java programs work, but I am having trouble connecting to a MySQL database. I installed these packages using Synaptic Package Manager.
1.gsfonts-x11
2.java-common
3.odbcinst1debian1
4.sun-java6-bin
5.sun-java6-jdk
6.sun-java6-jre
7.unixodbc
After these packages were installed, I was not sure if I needed to do this, but I downloaded the MySQL connector from MySQL :: MySQL Connectors and installed in a directory called /home/mark/mysql/.
I then did "sudo gedit /etc/environment" and added a CLASSPATH to where I installed the connector:
Code:
I found an example Java program from Using JDBC with MySQL, Getting Started and stripped it down even further to test the MySQL connection.
This is the program I am running:
Code:
Could not find the main class: Jdbctest. Program will exit. I am new to Linux, Ubuntu, Java and MySQL, so I have probably left out something that is very obvious.
View 1 Replies
View Related
Mar 7, 2010
Groovy is an object-oriented programming language for the Java platform. I do not have experience in Java, only perl and shell scripts. Recently I have been asked to maintain a software written in groovy (also to make enhancements). So can I learn groovy without knowing java language. or isit I have to learn java before venturing into groovy.
View 1 Replies
View Related
Sep 29, 2010
I wrote a code in C to connect to MySQL by using mysql_real_connect function but I recieved error "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" (by using mysql_error function).
I also did the following things: in mysql I typed 'SHOW VARIABLES LIKE '%SOCKET%'', it returned /var/lib/mysql/mysql.sock I typed 'mysql_config --socket' in shell, it returned /var/lib/mysql/mysql.sock I modified /etc/my.cnf file
View 3 Replies
View Related
Sep 30, 2010
When I used a java program to find all the fonts available on java. On MSW7 has more fonts available than on java on Linux. Why is that? Where can I get more java fonts? tia
here's the program:
Code:
import java.awt.GraphicsEnvironment;
public class ListJavaFonts
{
public static void main(String[] args)
[Code]....
View 1 Replies
View Related
Dec 4, 2010
i want to pass variable in mysql qyery in c programming
View 1 Replies
View Related
Feb 18, 2010
Is the OpenJDK web plugin the only option for java web plugins? I uninstalled it to run the Sun JDK Update 18, but now I can't find another web plugin.
View 1 Replies
View Related
Nov 18, 2010
I am trying to use "find" but I can't quite get all of the switches right for it to work. I have a folder that contains many folders. Let's call that original folder "MyFiles". The subfolders contain java files (and those subfolders possibly contain subfolders that contain java files). Here is what I want to have happen:
0. Create a file to print to, call it "output.ps"
1. Find all of the Java files in the MyFiles tree.
2. For each java file that is found, append it to output.ps along with it's absolute path name.
So far I have:
find . -iname *.java
and this finds all of the java files for me. But then I can't get the files to print to a file using exec.
View 3 Replies
View Related
Oct 20, 2010
I am trying to set up a minecraft server, but I have encountered problems. I have been using Ubuntu Server, but I can't get everything to work just right. I was wondering if I just needed to find a new distro that doesn't take up much resources and can run a java applet and sync with dropbox.( I already have code to sync that up).
View 2 Replies
View Related
Dec 14, 2010
How do I check my hard disk Revolutions Per Minute (RPM) speed from a Linux shell prompt without opening my server case?
I referenced some other articles. they give only model number, serial number and disk space, but I need Hard disk RPM speed using shell script. any other Java program
View 3 Replies
View Related
Aug 18, 2010
I'm trying up upgrade my lab's ubuntu-based appserver to v10.04 from 9.04.
The problem is that the default lucid apt-get repositories do not contain the Sun's official distribution like Jaunty's does. Is there any way to get the official Java distribution on lucid (not sure how the others measure up) or is it just not officially supported?
View 4 Replies
View Related
Mar 2, 2011
downloaded the java .bin file from the website and made it excutable and ran in terminal... i got the 'done' message at the end of installation, so i restarted Firefox and verified if i had java. well, i got that message talking about missing plugins... i clicked it and click get missing plugins, It didn't find java on my computer!
View 3 Replies
View Related
Aug 26, 2011
I used
Quote:
sudo apt-get install eclipse
to install But I am not able to find the Java EE components is there a another step that I should do get Enterprise components installed or is there a different command
View 1 Replies
View Related
Mar 16, 2010
I'm trying to do a standard mod_jk setup--get apache to forward requests to Tomcat. I must admit that I'm not so familiar with the details of mod_jk, but I got this working before when I had used tomcat 6 directly from apache's website, but now that I've switched to the version in Ubuntu's repositories I can't get it working.
The log for mod_jk says:
Code:
[Mon Mar 15 23:59:41 2010] [5575:3004840816] [error] ajp_send_request::jk_ajp_common.c (1359): (ajp13_worker) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Mon Mar 15 23:59:41 2010] [5575:3004840816] [error]
[Code].....
View 1 Replies
View Related
Apr 2, 2011
I installed ubuntu 10.10 on a desktop to use for a media server, and plus some. Everything worked! I proceeded to install the nVidia driver for the 9800gt After it was installed I rebooted per the notification after installation.So now my computer loads directly into terminal and I can't start the GUI. I tried startx but it gave that whole warning about the "nopowerconnectorcheck".
So I've done my research and I bought a 650w psu. Still no dice. I know that there is a way to turn off the power connector check but I have no Idea how.
View 2 Replies
View Related
Aug 11, 2010
making/buying a 3 pin j2 serial connector for my computer to connect to a programable chip
View 1 Replies
View Related
Mar 19, 2011
I'm am very new at debian. I have tried to use the apt install to install java-package an fake root after it says cannot find java-package also fake root doesn't work?
View 5 Replies
View Related
Oct 5, 2010
I have the following spec:
- Intel Core 2 Duo 1.86Ghz
- 4GB Ram
- 1TB Hard Disk
- 256MB Nvidia GeForce Graphics Card
I believe my system is quite fast, yet programs like JDownloader and Vuze (aka azureus) are very slow. More so on the GUI side, not so much program functionality (although I have not tested this either). If I scroll down a list of items, it takes ages, it lags and response time is quite bad.Also, I have two java processes running, each using 200MB of memory. I am assuming one is for Vuze and the other is for Jdownloader. It seems to me that Windows XP/Windows 7 ran java applications much faster and had less ram. I definitely see that with Vuze as it never went into the 200MB area when under windows.
View 4 Replies
View Related