Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




View Creation And Jdbc Driver


Does someone know if it is possible to create a view on a table with the 4.0.18 mysql version ? And does someone know which Jdbc driver to use with the 4.0.18 mysql version ?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
JDBC Error - Javax.servlet.ServletException: Com.mysql.jdbc.driver
I get the following error when trying access my MySQL database from a jsp page.

I have copied the proper jar into the WEB-INF/lib and the /ext path of my CLASSPATH.

Am I misisng something?

+++++++++++++++++++++++++++++++++++++++++++++

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: com.mysql.jdbc.driver
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.ja va:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcesso r.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.ClassNotFoundException: com.mysql.jdbc.driver
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1352)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: 1198)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
com.mullen.cac.struts.action.TestDB.execute(TestDB.java:30)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcesso r.java:431)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

JDBC Driver Licensing And Distribution
We are developing a Report Generator that works with a number of databases.
In order to add support for MySQL, I need to understand the implications of
using the JDBC driver, and the effect it will have on the closed-source
application using it.

The question is: does the application making call on the GPLed JDBC driver
come under GPL? The driver itself is not going to be extended/reworked in
any way, but used "as is".

A related question: can the driver be freely distributed (bundled) with a
commercial application?

I never worked with MySQL, and hope that someone could shed some light on
this issue.

Mysql Jdbc Driver Problem
I am trying to connect to mysql database using connector/J jdbc driver
this is my code

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import java.util.*;

class JdbcTest1 {

public static void main(String[] args) {
// Connection conn = null;
// Statement st = null;
//R........................

View Creation Error
I am having a problem creating a view from someone elses script

Select A_S_P * 10 as [RT QTY]
*
*
*
Group By A_S_P * 10

It gives me Incorrect syntax near 10

Anything you can see right away that I am missing?

About JDBC
Well i work with intellution“s Proficy line of products and my clientes are using various database manager systems, now MySQL is very popular and i found a lot of clients using it, for progrmas like iFIX there is no problem we just use MyODBC and it is like a walk in the park, but trying to connect it with JDBC to other program (to be exact Proficy portal wich is made totally in Java) at least for me has been impossible.

would anyone please tell me how to connect, install and manage the .jar files under Windows XP? what step am i missing? where do i have to put install or copy this files? is there an application i am not using?

JDBC
I' m using the linux driver libmyodbc3-3-51.06.so, for connecting to a mysql database.
I set url to String url= "jdbc:odbc:mydsn;useUnicode=true&characterEncoding=ISO8859-1";
However I cannot get accented characters in textfields or textareas.

DB Creation.
Taken this example for a web site (like eBay) Don't care about analyze, it's
just for the example.

- table article, is a general table containing the article description.
- table seller, all the datas about a seller.
- table announce, all the datas concerning an announce
- table bill, concerning the billing process

the entities:
- the seller may have 0 or N articles (0:n)
- the annouce has (and must have) only 1 article (1:1)
- the announce belong to 1 and must belong to 1 seller. (1:1)
- the article has (and must have) only 1 announce (1:1)
- every announce must have 1 or N bills (1:n)
- every bill belong (and must belong) to 1 announce (1:1)
- any other possible reference.

May somebody give me the script for creating this database with referential
integriry (MySql 4.0)

I've no tool to create this and don't know the syntax.

Connecting With JDBC
I am using Hibernate and mySQL in my java application, and I had a hopefully very simple question. When I use JDBC to connect to mySQL over a remote network, is the password sent in clear text? If this is true by default, is there any way to change it? I do not want to move on to using an SSL connection for all of my queries due to the 35-50% performance penalty reported by the mySQL website. Ideally, we would like to authenticate without sending the password in clear text, but we are not concerned with someone sniffing our data once the authentication has taken place.

JDBC And X509
Connecting to mysql using a secure connection is not a problem and I've
configured it within a minute but now I've created a user which needs to
connect to the server using "REQUIRE X509" and I can't find a solution
to this problem.

JDBC To MySQL
I wrote a Java program to connect to MySQL using JDBC ...and it works fine...it connects and it does what is supposed to do.....however when I use the same program to connect to another MySQL server (in another machine) then I get an exception: "Server Configuration Denies access to data source" ....any ideas?

MySQL & JDBC
We currently have mySQL version 4.1.21 on our server. Does a version of JDBC come bundled with mySQL? If so what version is it?

JDBC To MySQL
I wrote a Java program to connect to MySQL using
JDBC ...and it works fine...it connects and it does what is supposed
to do.....however when I use the same program to connect to another
MySQL server (in another machine) then I get an exception: "Server
Configuration Denies access to data source" ....any ideas???

Classpath For JDBC
Do I need to set a classpath to get a connection between a java program and a database?

If I have to set a classpath in the command prompt in Windows - what must this classpath direct to - the .exe file where mysql is installed on my system?

Comment With JDBC
I'm just experiencing this new database, it's great. I have one question. Is it possible to get the column comment (set by the insert command) with JDBC somewhere in the metadefinitions? ... that would be great because I want to make a generator and could use this for several settings.

JDBC And MySQL
I want to create a Java-Applet, which communicates with a MySQL-Server.

My question:
Is it possible to use a Java-Applet without installing a Driver on the client?
What do I need?

Setting The First Row In JDBC
Consider a table with 100 entries in it. Say, I execute the following query from a JAVA application using JDBC: -

SELECT * FROM foo_table LIMIT 10 ORDER BY start_date DESC;

Due to 'LIMIT 10 ORDER BY start_date DESC' it will return me top 10 results.

How can I retrieve the next 10 in some later query, totally independent of any current query? I wish to do something like the Hibernate function Query.setFirstResult(int index); but using JDBC.

Mysal / Jdbc
why this code leads to SQLException? with SELECT * from FUNDS all is well.

SELECT FUNDS.ISIN, NAME, COUNTRY_NAME, CURRENCY_ID, UL_1.LOGIN AS CLOGIN,
UL_2.LOGIN AS MLOGIN
FROM FUNDS, COUNTRIES, USER_LIST ALIAS UL_1, USER_LIST ALIAS UL_2
WHERE FUNDS.COUNTRY_ID = COUNTRIES.COUNTRY_ID
AND
CREATOR = UL_1.USER_ID
AND MODIFICATOR = UL_2.USER_ID
UNION
SELECT FUNDS.ISIN, NAME, COUNTRY_NAME, CURRENCY_ID, UL_1.LOGIN AS CLOGIN,
NULL
FROM FUNDS, COUNTRIES, USER_LIST ALIAS UL_1, USER_LIST ALIAS UL_2
WHERE FUNDS.COUNTRY_ID = COUNTRIES.COUNTRY_ID
AND
CREATOR = UL_1.USER_ID
AND MODIFICATOR IS NULL
ORDER BY ISIN;

Map JDBC Types
I'm setting up a server-application on a tomcat that is developed for SQL Server or Oracle but I got the thankless task of trying to set up the application on a MySQL instead.
One part of setting up this is to port some properties-files and I cannot get the hang of it.
Is there some friendly soul out there that could give me a hand?
I've included the content of properties-files below for SQL Server and I believe you'll get how it should be ported to MySQL. Most part of the content is the same in all three files but I included them all anyway

MS SQL Driver
I have mysql installed on a linux box along with apache, tomcat.  I need to make a connection to a server with windows NT running MS SQL 2000, does anybody recommend a good odbc:jdbc driver to install on the linux system?

Table Creation Sql
Is there any way to have MySQL supply the SQL used to create a table?
Sort of like it does using the command line mysqldump tool, but direct from the actual MySQL server (i.e. one I could use to get the SQL from MySQL using PHP)?



Foreign Key Creation
I have a website that pulls data from a database. For some reason, after I add data to the database, from the site, the site will pull it up fine on the page, but then, sometimes, out of the blue, it does not. The data will be in the database, but it won't appear on the page. The strange thing about the whole situation is that when I add a new entry to the database, the site will find the information it couldn't find before and it will appear on the page...

4.0.15 Foreign Key Creation Bug?
The table creation script(at the end of this post) works fine on
4.0.1-alpha-win, but the foreign key constraints fail on 4.0.15-win. I
am starting the server with the same command for both versions:

mysqld-max-nt --console --transaction-isolation=SERIALIZABLE

In 4.0.15-win I can extract the following error after I run the table
creation script:

[test01] ERROR 1005: Can't create table '.ibdata#sql-a14_3.frm'
(errno: 150)

Also, the InnoDB status in 4.0.150-win shows:
------------------------
LATEST FOREIGN KEY ERROR
------------------------
030930 19:38:49 Error in foreign key constraint of table
ibdata/#sql-a14_3:
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint:
FOREIGN KEY (contactInfo_fk) REFERENCES contact(pk) ON DELETE SET NULL
See http://www.innodb.com/ibman.html for correct foreign key
definition.

But the above is wrong. I DO have an index defined on the foreign key,
it IS the first column in the index, and their IS NO type mismatch.
Since this works on 4.0.1, I have to think this is a bug. I need a
working version of the server that supports transaction savepoints.
Any help appreciated!!

# Connection: test01
# Host: localhost
# Saved: 2003-09-29 18:16:42
#
CREATE TABLE orderjoin (
owner BIGINT,owned BIGINT
) TYPE=InnoDB;
CREATE TABLE orders (
pk BIGINT UNSIGNED AUTO_INCREMENT NOT N.....................................

Sequence Creation
I am not able to create a sequence in MySql.. But its giving error.

Can any one pls tell me how can i do that?

Foreign Key Creation
my problem is that after creating a foreign key, I cannot see in MySQL/phpMyAdmin that a column is a foreign key, here is an example of 2 tables (I wanted to create a table with users in a community an create a table=relationship which contains the information about which users know each other):

CREATE TABLE `user` (
`id` double NOT NULL auto_increment,
`security_code` varchar(50) NOT NULL,
`active` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
);

CREATE TABLE `knows` (
`user_id_1` double NOT NULL,
`user_id_2` double NOT NULL,
KEY `benutzer_id_1` (`benutzer_id_1`),
KEY `benutzer_id_2` (`benutzer_id_2`)
);

Now ... after creating (using the ALTER command of MySQL) two foreign keys (linking 'knows' with 'user') in the 'knows' database (which are of course 'user_id_1' and 'user_id_2') I cannot see any changes on my tables in phpMyAdmin. Why? After using the export function of phpMyAdmin, there is nothing about the foreign keys in the generated SQL. Why?

And another question concerning the relationship 'knows', would you give me some idea about how to create it in DBDesigner 4 or Workbench? There is something that I do not understand:

In school we learned a lot about ERM. And in ERM you were able to define attributes for relationships (for example 'date' for table 'knows', which would inform me about when we have added the info). In DBDesigner a relationship can only be made as a connection between Entities, but without any attributes. And how would I define such recursive relationship like 'knows' (from above) in DBDesigner 4 then, so that the tool would add to the relationships foreign keys automatically and export the relationship 'knows' as a table later on?

Creation Of A CMS With PHP & MySQL
I'm currently trying to produce a CMS through the use of PHP & mySQL, the idea of this CMS is to allow the content of the site to be updated from a external source, i.e. The Client. Code:

Index Creation
im trying to create a couple indexes for some tables and keep getting errors with these ones.

CREATE UNIQUE INDEX IX_TBLADDRESS_PRI_UNQ ON TBLADDRESS
(CASE BISPRIM WHEN 1 THEN NOWNERI ELSE NULL
END ASC,
CASE BISPRIM WHEN 1 THEN SOWNERT ELSE NULL
END ASC);

CREATE INDEX IXDELEMAILQUEUE_MODIFIED ON TBLDELETEDEMAILQUEUE
(STR(DTIMEMO,'YYYYMMDD') ASC);

CREATE INDEX IXEMAIL_LOWER_EMAIL ON TBLEMAILADDRESS
(LOWER(SEMAILA) ASC);

CREATE UNIQUE INDEX IX_SCHOOLDOM_PRI_UNQ ON TBLSCHOOLDOMAIN
(CASE BISPRIM WHEN 1 THEN NSCHOOL ELSE NULL
END ASC);

CREATE UNIQUE INDEX IX_TBLSCHOOLSTATE_SCHOOLHEAD ON TBLSCHOOLSTATE
(CASE BISHEAD WHEN 1 THEN NSCHOOL3 ELSE NULL
END ASC, CASE BISHEAD WHEN 1 THEN SMODULE ELSE NULL
END ASC);

CREATE INDEX SPONSORTRAN_LOWER_EMAIL_IDX ON TBLSPONSORLOADTRANSACTION
(LOWER(SSPONSE) ASC);

Format Creation
I have 2 tables:

Table1 contains (among other things):

ID Data1 Data2 Data3
1 aaa bbb ccc
2 ddd eee fff
3 ggg hhh iii

Table2 contains (among other things:

ID Key Value
1 20 zzz
1 30 yyy
1 40 xxx
2 20 www
2 30 vvv
2 40 uuu
3 20 ttt
3 30 sss
3 40 rrr

I need a query that returns:

ID Data1 Data2 Data3 Value Value Value
(Key=20) (Key=30) (Key=40)
1 aaa bbb ccc zzz yyy xxx
2 ddd eee fff www vvv uuu
3 ggg hhh iii ttt sss rrr

Any ideas?

Foreign Key Creation
I'm creating a calendar scheduling system with PHP and MySQL to keep track of lessons. I have one form in which the user enters the information about the event that needs to be scheduled. Then I need three entries to be made in three different tables. What I have is one table that keeps track of the entries in the calendar. Then I have two more, one for how much the teacher needs to get paid as a result of the number of hours and the other is how much the student needs to pay based on the hours. The only problem is that I want the student and teacher paying tables to have the unique ID of the calendar entry to which the payments are associated.

So the problem is I can insert the entries into the calendar tables, and it will automatically create a unique ID for that entry, but then how can I take the ID for that entry and insert it into the two other tables. The best I could come up with is somehow query the last entry created but i'm not sure how, or even if that is a good way of doing it.

How To Set Creation Time
I have one table which i only fill with data once in a while.
then i would truncate it and fill all data using INSERT INTO ... SELECT ...

but that would not reset the creation date. so i cant know how old the data is.

so i changed my scriot to drop the table and recreate it. but then the creation date is still the same. how can that be?
i tried FLUSH with no success.

Getting Time Of Row Creation
I have some rows in a table and I was wondering if it was possible to find out through some PHP or mysql function when that row was added. Unfortunately, the structure was not setup to have a time or date column with timestamps.

Table Creation
I'm creating a table and would like to get the system date for my date column. How would I do this.

I tried to use

date date SYSDATE

with no luck.

Also when adding values to the DB, would I insert anything in this column or just leave it out like and autoincrement column??

Mysql Creation
I have installed Fedora core 3 with mysql database.Now I am able to connect to mysql database.But I have to create user and table .How to go ahead

Table Creation
I tried using MySQL Admin, but am finding that it is buggy AND I am having touble creating a table with an auto increment key as well as setting another field UNIQUE.
Would it be easier for me to create my tables manually or is there less buggy freeware out there for table creation?

Connection Issue - Jdbc And Xml
I am using mysql 5 and need to connect to it from an application.  I am running tomcat 4.1, mysql 5 and jave sdk 6 on Windows server 2000.  I have the following placed in an xml file, but the error log tells me that it is unable to connect can anyone assist me?

I have asked the same on a tomcat site.....

Jdbc / Odbc Connection
I am running Suse 10.1 and i have MySQL working fine but Im having problems with connecting my Java Application with my Database. I got the recent J Connector drivers but i keep getting the exception about it not being able to find my device driver. The only other thing I was un-able to figre is where is "%Java_home% /jre/lib" is that only for windows?

Configuring MySQL For JDBC ?
I'm having a MySQL DB running on one machine and a Java-Tool which accesses this DB via JDBC. With this tool, I can add a second DB data source in form of a mySQL DB and I've installed one more MySQL DB on a third machine, which runs perfect, but the access from the java-tool via JDBC-connection doesn't work.

Command line "mysql" tool work perfect from the machine where the java tool is running. The company which coded the java-tool told me that I have to install a package for the mysql db which enables jdbc. Is that right and what do I have to configure ?

Com.mysql.jdbc.MysqlDataTruncation:
I just upgraded to MySQL to 4.1.9 and JDBC
mysql-connector-java-3.1.6-bin.jar and now getting the following Exception:

com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for
column 'usaCard' at row 1

What causes this exception?

I've set jdbcCompliantTruncation=false for the time being but would like to
understand what causes the Exception.

Connecting Between JDBC And ODBC
I have a linux machine set up with MySQL, and I would like to connec to the database using Java I have already connected to the database using the [mysql-connector-java-3.0.9-stable-bin.jar] but I would like to connect using ODBC. Code:

Jdbc Over SSL, SAP Business Connector 4.6
I have set up a connection between SAP Business Connector 4.6 and MYSQL. I'm currently using jdbc driver com.mysql.jdbc.Driver (mysql-connector-java-3.0.16-ga-bin.jar).

Using DB URL jdbc:mysql://<ip>/<database> the connection is working fine.

So far so good.

Now my problem:
I need to set up a SSL connection but in MySQL Connector/J Documentation is stated:
'For SSL Support to work, you must have the following:

A JDK that includes JSSE (Java Secure Sockets Extension), like JDK-1.4.1 or newer. SSL does not currently work with a JDK that you can add JSSE to, like JDK-1.2.x or JDK-1.3.x due to the following JSSE bug:

http://developer.java.sun.com/developer/bugParade/bugs/4273544.html'

My SAP business connector is running under jdk 1.3.0

How do I get SSL running?

[java] Jdbc, More Than One Sql Command
I use Connector/J ver. 3.0 (downloaded from mysql.com).

Does anybody know why I cannot execute something like that in my Java
program:

stat.execute("CREATE TABELE a(b int);INSERT INTO a(b) VALUES(1);");
???

something like this works fine:
stat.execute("CREATE TABELE a(b int);");
stat.execute("INSERT INTO a(b) VALUES(1);");

i was trying to change the string:
"CREATE TABELE a(b int);
INSERT INTO a(b) VALUES(1);"
"CREATE TABELE a(b int); INSERT INTO a(b) VALUES(1);"
and nothing works.

Can anyone tell me why this jdbc driver cannot take this??? If I put the
string:
"CREATE TABELE a(b int);INSERT INTO a(b) VALUES(1);"
into mysql console everthing works fine....

I don't get it. I was trying to run it in pg, and evertyhing worked fine.

JDBC Rowcount() Too Much Slow
Does MySql 5.0 go over all records of a InnoDB data base when I ask for RowCount() . It's excessively slow with very much records.

How To Use Jdbc To Connect To Database?
I have installed MySQL4.1.9 and installed JDBC driver connect J/3.1 I installed MySQL in C:MySQL and I have copied the "mysql-connector-java-3.1.6-bin.jar" file into <java home>jrelibext , <java runtime environment home>libext and <Tomcat Home> commonlib.

I started up MySQL from the commandline client and created a 'books ' database using "CREATE DATABASE books;". I have also added the statement: GRANT ALL PRIVILEGES ON *.* TO '<user>' IDENTIFIED BY '<password>' WITH GRANT OPTION;

The problem is when I try to use java to access the database via jdbc. I typed the code:
Connection con = null;
Class.forName("org.gjt.mm.mysql.Drive").newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/books ?user=<user>&password=<password>");

It compiles correctly but when i execute the code,it displays: "SQLException: java.sql.SQLException: Incorrect database name 'books ' "

I changed the statement to:
con = DriverManager.getConnection("jdbc:mysql:books ?user=<user>&password=<password>");
but when executing,the message now is: SQLException: java.sql.SQLException: No suitable driver

I have tried checked the jdbc manuel online but the con statement given is about the same. It seems that somehow jdbc cannot find the database and the driver is not recognised also.

Can't Establish JDBC Connection
I'm developing a small java web-app for a client using JSP, Servlets and a MySQL db. The app-server and database are leased from a third party vendor, so all my work is done remotely. I've uploaded my app and am trying to establish a connection but can't. The exception is this:

Access denied for user: 'username@localhost.localdomain' (Using password: YES)

and occurs at line:


Code:

Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/database","username","pwd");

JDBC And Mysql Errors
I developed the java code to create data object's that is created from the class mpcData, the main database connectivity is mpcConnect now when i initially developed the code it compiled error free, soon as i added the classpath to the directory containing the Mysql drivers ( "c:jdbcDriver") in my windows system environment i'm getting error's in the compiling that i cannot find the data object mpcData anymore.

Case Sensitive JDBC
I have an aplication JSP-JAVA-SQL Server. And I migrated to MySQL, but in MySQL the SQL its all case sensitive so I would have to change the SQL code in JAVA (that would be crazy, even with find-replace).

The obvious solution is to change the charset and/or collation but I can't find the way to do it.There a way of when connecting to the DB in JAVA to say through the JDBC that all transactions will be Case-Insensative?

JDBC Number Rows
After you have done a .executeQuery() and returned that to a ResultSet how do you get the number of rows returned?
I have tried using getFetchSize() but that does not help me.

Install Jdbc Drivers
I want to interact with MYSQL db using java........for that i need jdbc drivers.somebody please send me the links and installation steps.

IPS Driver Error
I am getting two errors on a forum. The first is an IPS Driver Error:

IPS Driver Error
There appears to be an error with the database.
You can try to refresh the page by clicking here

the second is this (in PHPMyAdmin):

MySql Driver?


I would like to know what kind of problem could trigger this error:

Quote:

Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The mysql driver is not currently installed' in C:wampwww estlibraryendDbAdapterPdoAbstract.php:79

I am using the Zend Framework and I am simply trying to insert data in a table.

How could I install a mysql driver? phpmyadmin works fine.


Copyright © 2005-08 www.BigResource.com, All rights reserved