JDeveloper 10.1.2 with MySQL and PostgreSQL
I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
I made three tests and they were all disappointing.
At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
As I run the application, the embedded OC4J immediately returns this error:
oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
at oracle.jbo.JboException.<init>(JboException.java:343)
(in english: Error during JDBC connection)
There are no other available JDBC drivers for JVM 1.4x so I see no solution...
I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
Anyone can help? Is it a JDev 10.1.2 issue?
Hi Paolo.
I'm also doing such tests.
I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
But, the other big problem you will face is related to updating records using postgreSQL connection.
Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
It would by fine if we help each other to solve this problems.
Thanks
Denis
Similar Messages
-
Comparison of Oracle, MySQL and PostgreSQL DBMS
Hi,
Wanted to share this article:
http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html
Regards,
Priyankathanks for the link. i wonder how they determined
the % of installations though.
anyone know?Very approximately it would seem. They quote market share as of July 1 2004 showing MySQL at 33%, the same numbers are on the MySQL site.
SQL Server with 78%, Oracle - 55%, MySQL - 33% and PostgreSQL - 8%.
While this story from June 4 2004 quoting IDC research has the Market shares for 2003 at
http://www.internetnews.com/stats/article.php/3363801
Oracle garnered 39.8 percent of the market for software that helps users retrieve and store information, with IBM nabbing 31.3 percent and Microsoft grabbing 12.1, ... open source database leader MySQL's market share is a negligible one-tenth of 1 percent now
And I'm sure a bit more googling could throw up even more wildly different numbers.
Like this more recent Gartner survey for 2005
http://www.forbes.com/markets/2006/05/25/oracle-0525markets13.html
According to the Gartner study, Oracle (nasdaq: ORCL - news - people ) enjoys about 50% of the total RDBMS market
This would be nice if Oracle ever implemented it,
Oracle: Yes. ON DELETE CASCADE supported
PostgreSQL: Yes. ON DELETE CASCADE and ON UPDATE CASCADE supported. Message was edited by:
3360
I never noticed that the quoted numbers don't even add up to 100% percent so it is not really market share. -
Issue in bringing up CRS on ATG 10.1.1 with MySQL and Weblogic 10.3
Hello,
I am trying to bring up Commerce Reference Store as part of my evaluation using MySQL (bundled with ATG) and WebLogic 10.3.
I followed the ATG Documentation on CRS with WebLogic and MySQL and I could not proceed because of the below error log. I keep getting error in OnlineCreateServerInstanceTask of CIM. I believe it should be some configuration problem, but could not think of any.
As part of the installation, I use C:\jdk1.6.0_25. I verified my weblogic server is up through the admin console. I started MySQL before running the eval batch. Apart from starting MySQL server, I did not make any datasource/database configuration changes for ATG. I have not run any other scripts to configure MySQL too.
Please guide me to resolve the problem.
C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval>configureEval.bat
Do you wish to run the CRS evaluation installation? [Y/N]: y
Do you wish to use an existing database for the CRS evaluation? [Y/N]: n
The CRS evaluation install will attempt to create the database. Press [Return] t
o continue or any other key to quit:
Enter mysql database connection details
Enter user name: admin
Enter user password: admin
Enter database name: crsprod
Enter 'root' user password:
Creating database...
Finished database creation
Enter weblogic admin server URL: http://localhost:7001
Enter weblogic admin server username: weblogic
Enter weblogic admin server password: weblogic123
Buildfile: C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval\evalbuild.xml
all:
[copy] Copying 1 file to C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval
[delete] Deleting: C:\ATG\ATG10.1.1\CommerceReferenceStore\Store\eval\cimOut.
cim.tmp
BUILD SUCCESSFUL
Total time: 0 seconds
Application Server: weblogic
The following installed ATG components are being used to launch:
ATGPlatform version 10.1.1 installed at C:\ATG\ATG10.1.1
Created "C:\ATG\ATG10.1.1\home\CIM\startDynamo.jar" in 15,273ms.
Nucleus running
atg.cim.productconfig.productselector.ProductSelectionContextTask starting...
(Searching for products... done.)
atg.cim.productconfig.productselector.ProductSelectionContextTask finished.
atg.cim.productconfig.appserver.AppServerSelectTask starting...
atg.cim.productconfig.appserver.AppServerSelectTask finished.
atg.cim.productconfig.appserver.AppServerPathTask starting...
atg.cim.productconfig.appserver.AppServerPathTask finished.
atg.cim.productconfig.appserver.DomainPathTask starting...
atg.cim.productconfig.appserver.DomainPathTask finished.
atg.cim.productconfig.appserver.UrlTask starting...
atg.cim.productconfig.appserver.UrlTask finished.
atg.cim.productconfig.appserver.UsernameTask starting...
atg.cim.productconfig.appserver.UsernameTask finished.
atg.cim.productconfig.appserver.PasswordTask starting...
atg.cim.productconfig.appserver.PasswordTask finished.
atg.cim.productconfig.appserver.AppServerSelectionPersistenceTask starting...
atg.cim.productconfig.appserver.AppServerSelectionPersistenceTask finished.
atg.cim.database.CreateSchemaTask starting...
atg.cim.database.CreateSchemaTask finished.
atg.cim.database.ImportDataTask starting...
Combining template tasks...Success
Importing (1 of 1) /CIM/tmp/import/nonswitchingCore-import1.xml:
/CommerceReferenceStore/Store/Storefront/data/pricelists.xml to /atg/commerce/pr
icing/priceLists/PriceLists
/CommerceReferenceStore/Store/Storefront/data/stores.xml to /atg/store/stores/St
oreRepository
/CommerceReferenceStore/Store/Storefront/data/catalog-i18n.xml to /atg/commerce/
catalog/ProductCatalog
/CommerceReferenceStore/Store/Storefront/data/pricelists-i18n.xml to /atg/commer
ce/pricing/priceLists/PriceLists
/CommerceReferenceStore/Store/Storefront/data/sites.xml to /atg/multisite/SiteRe
pository
/CommerceReferenceStore/Store/Storefront/data/sites-i18n.xml to /atg/multisite/S
iteRepository
/CommerceReferenceStore/Store/Storefront/data/promos-i18n.xml to /atg/commerce/c
atalog/ProductCatalog
/CommerceReferenceStore/Store/Storefront/data/seotags-i18n.xml to /atg/seo/SEORe
pository
/CommerceReferenceStore/Store/Storefront/data/wishlists.xml to /atg/commerce/gif
ts/Giftlists
/CommerceReferenceStore/Store/Storefront/data/inventory.xml to /atg/commerce/inv
entory/InventoryRepository
/CommerceReferenceStore/Store/Storefront/data/users.xml to /atg/userprofiling/Pr
ofileAdapterRepository
/CommerceReferenceStore/Store/Storefront/data/orders.xml to /atg/commerce/order/
OrderRepository
/CommerceReferenceStore/Store/Storefront/data/orders-i18n.xml to /atg/commerce/o
rder/OrderRepository
/CommerceReferenceStore/Store/Storefront/data/storetext-i18n.xml to /atg/store/s
tores/StoreRepository
/CommerceReferenceStore/Store/Storefront/data/claimable-i18n.xml to /atg/commerc
e/claimable/ClaimableRepository
... > Success
All Imports Completed Successfully
atg.cim.database.ImportDataTask finished.
atg.cim.worker.common.PropertyFileClearPersistanceTask starting...
atg.cim.worker.common.PropertyFileClearPersistanceTask finished.
atg.cim.productconfig.serverinstance.ServerInstanceNameTask starting...
atg.cim.productconfig.serverinstance.ServerInstanceNameTask finished.
atg.cim.productconfig.serverinstance.PortBindingsSelectTask starting...
atg.cim.productconfig.serverinstance.PortBindingsSelectTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.worker.common.MapPropertyFileCreatorTask starting...
atg.cim.worker.common.MapPropertyFileCreatorTask finished.
atg.cim.productconfig.serverinstance.MakeServerInstanceFromPatternTask starting.
atg.cim.productconfig.serverinstance.MakeServerInstanceFromPatternTask finished.
atg.cim.productconfig.appassembly.EarFileNameTask starting...
atg.cim.productconfig.appassembly.EarFileNameTask finished.
atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask starting...
Error Executing Batch File
atg.cim.worker.TaskException: Error deploying to weblogic
atg.cim.worker.TaskException: Error exececuting batch file
at atg.cim.flow.CimFlowCreator.startHeadlessCimFlow(CimFlowCreator.java:
130)
at atg.cim.Launcher.startCimFlow(Launcher.java:278)
at atg.cim.Launcher.main(Launcher.java:99)
Caused by: atg.cim.worker.TaskException: Error deploying to weblogic
at atg.cim.worker.Task.handleException(Task.java:72)
at atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask.
execute(OnlineCreateServerInstanceTask.java:159)
at atg.cim.headless.HeadlessExecutorImpl.executeTasks(HeadlessExecutorIm
pl.java:150)
at atg.cim.headless.HeadlessExecutorImpl.populateAndExecuteHeadlessTasks
(HeadlessExecutorImpl.java:140)
at atg.cim.batch.BatchChooserExecutor.populateAndExecuteHeadlessTasks(Ba
tchChooserExecutor.java:169)
at atg.cim.flow.CimFlow.headlessFlow(CimFlow.java:116)
at atg.cim.flow.CimFlowCreator.startHeadlessCimFlow(CimFlowCreator.java:
120)
... 2 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:348: The following
error occurred while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:254: The following error occur
red while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at atg.cim.task.ant.utility.AntExecutionWrapper.executeAntTarget(AntExec
utionWrapper.java:167)
at atg.cim.worker.AntTask.executeAntTarget(AntTask.java:115)
at atg.cim.productconfig.deploy.weblogic.OnlineCreateServerInstanceTask.
execute(OnlineCreateServerInstanceTask.java:155)
... 7 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:254: The following
error occurred while executing this line:
C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned: 1
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(Projec
tHelper.java:541)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:394)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:391)
... 20 more
Caused by: C:\ATG\ATG10.1.1\CIM\plugins\Base\ant\cim-ant.xml:214: exec returned:
1
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor132.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.jav
a:391)
... 34 more
Nucleus shutting down
Nucleus shutdown complete
Thanks.This error is resolved after following the logs in C:\ATG\ATG10.1.1\CIM\log\cim.log. The root cause is I used http as protocol instead of t3 while specifying weblogic admin url.
http://localhost:7001 instead of t3://localhost:7001
Thanks. -
Performance with MySQL and Database connectivity toolbox
Hi!
I'm having quite some problems with the performance of MySQL and Database connectivity toolbox. However, I'm very happy with the ease of using database connectivity toolbox. The background is:
I have 61 variables (ints and floats) which I would like to save in the MySQL-database. This is no problem, however, the loop time increases from 8ms to 50ms when using the database. I have concluded that it has to do with the DB Tools Insert Data.vi and I think that I have some kind of performance issue with this VI. The CPU never reach more the 15% of its maximum performance. I use a default setup and connect through ODBC.
My questions are:
1. I would like to save 61 variables each 8-10ms, is this impossible using this solution?
2. Is there any way of increasing the performance of the DB Tools Insert Data.vi or use any other VI?
3. Is there any way of adjusting the MySQL setup to achieve better performance?
Thank you very much for your time.
Regards,
MattiasFirst of all, thank you very much for your time. All of you have been really good support to me.
>> Is your database on a different computer? Does your loop execute 61 times?
Database is on the same computer as the MySQL server.
The loop saves 61 values at once to the database, in one SQL-statement.
I have now added the front panel and block diagram for my test-VI. I have implemented the queue system and separate loops for producer and consumer. However, since the queue is building up faster then the consumer loop consumes values, the queue is building up quite fast and the disc starts working.
The test database table that I add data to is created by a simple:
create table test(aa int, bb char(15));
...I'm sure that this can be improved in some way.
I always open and close the connection to the database "outside the loop". However, it still takes some 40-50 ms to save the data to the database table - so, unfortunatly no progress to far. I currently just want to save the data.
Any more advise will be gratefully accepted.
Regards,
Mattias
Message Edited by mattias@hv on 10-23-2007 07:50 AM
Attachments:
front panel 2.JPG 101 KB
block diagram.JPG 135 KB -
Database setup with MySQL and PHP question
Hello all,
I recently had a problem getting a report to work for a site I was updating. This site is written in PHP with a MySQL database. The application is to track customer calls to auto repair stores. The database has a lot of foreign keys because they wanted to update information in only one spot and have multiple records be updated all at once. So, I've got all the information from individual calls saved in the call_log table, and have foreign keys to reference information in other tables (for example this table lists what store received the call referencing the store table). If a store changes locations, they want to have reports automatically update with the new address, connection to conversation number, etc.
In one of the responses to my question on how to get this report to work, I was told that this could be done without using foreign keys (by Normalizing the database using mapping tables). I am still a newbie to MySQL, and after looking though a lot of manuals, tutorials, and forum posts, I am more confused now than ever.
I got the report to work using the foreign keys, but I would like to learn what I should have done with the database (and how to get the information displayed).
So for example one report would be displaying the following:
Store Reason for the Customer Call
breaks oil change shocks tune up total calls
5636 - Bloomington 2 4 0 2 8
8875 - Duluth 1 6 4 8 19
with links on the store name to pull up the information on that specific store. How would I change the database (listed below) to do this without foreign keys? Any help would be greatly appreciated.
call_log (table that contains the following:)
call_id
conv_number
date
camp_type (foreign key to the campaign table so it displays the campaign_id)
reason (foreign key to the call_reason table so it displays the reason_id)
location (foreign key to the store table so it displays the store_id)
associate
call_summary
trainig_issue (foreign key to the training_points table so it displays the training_key_id)
visit_closed
example (foreign key to the example_type table so it displays the example_id)
campaign (table that contains the following:)
campaign_id
campaign_name
campaign_promotion
campaign_coupon
campaign_startdate
campaign_enddate
call_reason (table that contains the following:)
reason_id
reason
store (table that contains the following:)
store_id
store_number
store_address
store_city
store_state
store_postalcode
store_name
store_phone
store_email
store_mgr
training_points (table that contains the following:)
training_key_id
key_issue
policy
example_type (table that contains the following:)
example_id
example_name
example_image
Thank you very much.Frankly, that is way to much of a question to be answered in detail on a forum... There's a lot involved and a lot of general database understanding required. I would highly recommend:
Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design, Second Edition -- by Michael J. Hernandez
This is an invaluable book to get you going in the right direction and on a firm foundation.
Lawrence *Adobe Community Expert*
www.Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
www.twitter.com/LawrenceCramer -
Need help setting up JDBC with mySQL and Netbeans
I've successfully got mySQL up and running and created a few simple test databases. I've been following the instructions on this website (http://www.stardeveloper.com/articles/display.html?article=2003090401&page=1 ) to get JDBC working but have had little luck.
I've downloaded JDBC from mySQL website, extracted the mysql-connector-java-3.1.13-bin.jar file and changed the class path to :
C:\Program Files\Java\jre1.5.0_06\lib\ext\mysql-connector-java-3.1.13-bin
which is where I placed the .jar file.
I then used the following code provided on stardeveloper.com to test a connection with the test database.
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class JdbcExample2 {
public static void main(String args[]) {
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection("jdbc:mysql:///test",
"root", "secret");
if(!con.isClosed())
System.out.println("Successfully connected to " +
"MySQL server using TCP/IP...");
} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {}
}It compiles but when run I get the error message :
java.lang.NoClassDefFoundError: testdatabase/JdbcExample2
Exception in thread "main"I assume this means that my classpath isn't setup correctly but I have no idea what's up and how to correct it.
Can someone PLEASE tell me how to setup jdbc and what I've done wrong.
Thanks in advance :)Thanks for your reply. I've made some progress but I'm still having problems.
In mySQL I created a new user called uraknai with password n0121429 and granted them access to a test database I created called pet.
Then, in netbeans, I clicked the Runtime tab, clicked Databases and rightclicked Drivers and clicked Add Driver. I then added the driver mysql-connector-java-3.1.13-bin.jar. I then right clicked the newly added driver and selected the connect using option. I filled in the appropriate boxes clicked ok and it connected successfully.
Then, under the project tab, I right clicked the project name, clicked properties then clicked Libraries and added the .jar file mysql-connector-java-3.1.13-bin.jar
I then ran the following code to test the connection to the database:
import java.sql.*;
public class ConnectionTest {
public ConnectionTest() {
public static void main(String[] args)
System.out.println("BEGIN CONNECTION TEST");
Connection conn = null;
try
String userName = "uraknai";
String password = "n0121429";
String url = "jdbc:mysql://localhost/pet";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
catch (Exception e)
System.err.println ("Cannot connect to database server");
finally
if (conn != null)
try
conn.close ();
System.out.println ("Database connection terminated");
catch (Exception e) { /* ignore close errors */ }
}and get the message:
java.lang.NoClassDefFoundError: math/ConnectionTest
Exception in thread "main"
Java Result: 1when I run the code.
Can someone explin what I've done wrong and how to fix the problem.
Cheers. -
I am having trouble with php and postgresql on OS X 10.7.5
I have php, postgresql 5.3.23, and apache installed. However, when I go to my web browser and open the pages things don't work when I try to enter info in the search boxes. I get this error immediately upon typing something in the search box.
Fatal error: Call to undefined function pg_pconnect() in /www/Includes/file.php on line 12
I have installed and configured the php.ini file to reflect extension=pcntl.so and extension=pgsql.so, restarted apache, and still no luck. I have to be just missing some minor thing that is major in terms of workability. Can anyone help?I have noticed that this error is being recorded in the Apache logs.
Warning: PHP Startup: Unable to load dynamic library '/opt/local/lib/php/extensions/pgsql.so' - dlopen(/opt/local/lib/php/extensions/pgsql.so, 9): Library not loaded: /usr/lib/libpq.5.dylib
Referenced from: /opt/local/lib/php/extensions/pgsql.so
Reason: image not found in Unknown on line 0
This has got to be the "missing" piece of my puzzle, but I am having no luck finding what to do about it. I have tried making a link to the libpq.5.3.dylib with no success.
Anyone know what I'm doing wrong? -
Starting with MySQL and mm.mysql-2.0.11
Hello,
I trying to connect to a MySQL database from a java program, and I would need help on how does it work exactly in java.
I downloaded the driver called mm.mysql-2.0.11 but can find the api for it..
From what I read around on different site, you don't even use them but use the JBDC.
Where is the connection between the two?
If anyone could show me a short listing with the import and everithing of a simple object that connect to a MySQL database and that just enter some information in a table, or tutorial on the subject I would apreciate it.
Thanks.
btw, the MySQL database work fine on the command line.JDBC is a standard API for accessing databases from Java. What you have downloaded is a JDBC driver that implements JDBC connectivity to the mySQL RDBMS.
You simply need to register the driver class and then create a connection to it.
// register the JDBC driver
Class.forName("org.gjt.mm.mysql.Driver");
// connect to the db
java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://servername/dbname", username, password);Then use the Connection to create statements that access the database. Replace servername and dbname in the JDBC url passed to getConnection with the appropriate values for your environment. -
I have a quite annoying problem.....!
I use the getText() method to extract characters from a textfield pass them as a string and then using an INSERT store them in the database. When i am entering in the textfield something like the word - Java - everything is ok. When i am entering something like - Java Deceloper's Guide - the connection with the database fails.....!!! I have found that the problem is with the use of the apostrophe ( ' )!!
Anyway to ovecome this???
Thanx in advance!Thanx again!
It worked!!!!
By the way this was quite a stupid (i think) issue with JDBC, nevermind.
Thanx -
Query Folding for MySQL and PostgreSQL
Hi there!
I use simple M code (see below) but PQ load all rows instead of doing Query Folding.
What's wrong?
let
Source = MySQL.Database("10.8.0.10", "leb"),
leb_x_sale_orders = Source{[Schema="leb",Item="x_sale_orders"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(leb_x_sale_orders,{"ID", "CANCELED", "PRICE", "USER_ID", "DATE_INSERT"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each Date.IsInPreviousDay([DATE_INSERT]))
in
#"Filtered Rows"Thank you for the feedback. From a quick look, perhaps the Date functions are not folding. Here is a relevant
post.
You may consider to use text functions as a workaround, or wait till we check this out. -
Php with mysqli, mbstring and xsl extensions
I don't understand why php isn't build with mysqli and mbstring extensions since mysql4 is installed and there are a lot of languages that need multibytes strings. Here is a PKGBUILD that enable them. I also added xsl extension to use xsl files with php.
# $Id: PKGBUILD,v 1.51 2004/12/16 22:03:19 judd Exp $
# Maintainer: dorphell <[email protected]>
# Contributor: Benoit Chesneau <[email protected]>
pkgname=php
pkgver=5.0.3
pkgrel=2
pkgdesc="A high-level scripting language"
url="http://www.php.net"
backup=(etc/php.ini)
depends=('openssl' 'libjpeg' 'freetype2' 'libpng' 'pam'
'gdbm' 'libxml2' 'openldap' 'ncurses' 'curl' 'libxslt')
makedepends=('apache' 'mysql' 'imap' 'postgresql' 'bzip2' 'smtp-server'
'gd' 'fam' 'sqlite3' 'unixodbc')
source=(http://www.php.net/distributions/$pkgname-$pkgver.tar.gz php.ini)
md5sums=('bf89557056ce34d502e20e24071616c7' 'd5b9b37fbb746f0967d795763106735a')
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --with-apxs2 --prefix=/usr --sysconfdir=/etc
--with-layout=PHP
--with-ttf --enable-mailparse --with-config-file-scan-dir=/etc
--enable-bcmath=shared --enable-calendar=shared --enable-ftp=shared
--enable-gd-native-ttf --enable-magic-quotes --enable-posix=shared
--enable-session --enable-shared --enable-shmop=shared --with-imap
--with-imap-ssl --with-ncurses --with-readline --with-sqlite=shared
--enable-sysvsem=shared --enable-sysvshm=shared --enable-track-vars
--enable-trans-sid --enable-safe-mode --enable-sockets=shared
--enable-xml --with-bz2=shared --with-curl --with-mime-magic
--with-unixODBC=shared
--enable-dba --without-db2 --without-db3 --with-inifile --with-flatfile
--with-gdbm --with-freetype-dir=/usr --with-gd=shared --enable-exif
--with-jpeg-dir=/usr --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config
--with-ldap=shared
--with-mysql-sock=/tmp/mysql.sock --with-openssl --with-gettext
--with-pear=/usr/share/pear --with-dom --with-dom-xslt
--with-pgsql=shared --with-pgsql-sock=/tmp/pgsql.sock
--with-png-dir=/usr --with-regex=php --with-zlib --with-fam=shared
--with-xsl
--enable-mbstring=all --enable-mbregex
# fixes a build error in sqlite support
ln -s main/php_config.h ./config.h
make || return 1
mkdir -p $startdir/pkg/usr/lib/apache
# cp config_vars.mk config_vars.old
# sed "s|^INSTALL_IT.*$|INSTALL_IT = apxs -i -a -S LIBEXECDIR=$startdir/pkg/usr/lib/apache -n php4 libs/libphp4.so|" config_vars.old >config_vars.mk
sed -i "s|-i -a -n php5|-i -n php5|g" Makefile
make INSTALL_ROOT=$startdir/pkg EXTENSION_DIR=/usr/lib/php install
cp ../php.ini $startdir/pkg/etci suggest filing a feature request through the bug tracker.
As for why such features may not be compiled in is that whoever maintains the package may have never had the need to have such features in php or experienced any issue because of it. You will experience this with many distros so I suggest not getting accusatory and simply request the feature through the proper channels.
Each persons needs and experience are different and that is why developers write their code to encompass as many features as their users request. How robust a package needs to be in arch is up to people like you giving the crucial feedback.
(btw i don't see why your request would not be granted. I suggest the feature request though because i know the maintainer of the PHP package is not a frequent visitor to this forum but he will get your request if you make to the bug tracker) -
GenerationType.AUTO doesn't work correctly with Kodo and MySQL
Greetings,
I'm migrating applications from JBoss/Hibernate to WebLogic/Kodo. The following column annotation:
@Id
@Column(name="CUSTOMER_ID")
@GeneratedValue(strategy = GenerationType.AUTO)
public long getCustomerId()
is supposed to generate auto-increment primary key in mysql. This is what happens with Hibernate. With Kodo, this seems to be equivalent with GenerationType.TABLE as a table named openjpa_sequence_table is created, containing sequence values. So what should one do in order to be able to use true auto-increment strategy with MySQL and Kodo ?
Many thanks in advance,
NicolasHi Nicolas,
By setting the generation strategy to AUTO, you're essentially letting the JPA provider choose which strategy to use. It looks like Kodo is using the TABLE strategy by default and Hibernate is using the IDENTITY strategy here. You can set the strategy to IDENTITY if you want Kodo to behave similarly to Hibernate. However, it's worth pointing out that there may be a reason for Kodo not using the IDENTITY strategy by default.
The docs at: http://edocs.bea.com/wls/docs103/kodo/full/html/ref_guide_pc_oid.html#ref_guide_pc_oid_pkgen_autoinc
point out the following:
"Statements inserting into tables with auto-increment / identity columns cannot be batched. After each insert, Kodo must go back to the database to retrieve the last inserted auto-increment value to set back in the persistent object. This can have a negative impact on performance. "
- Matt -
Has anybody had any experience using either mySQL or postgreSQL?
I am currently looking at a project requiring database integration and in addition to the usual suspects (Oracle, SQL Server) I am also interested in mySQL and postgreSQL. Advantages? Disadvantages? Has anybody used these with LV--especially to store BLOBS?
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First StepsMike,
Here are the main differences...
MySQL is licensed under the GPL, but for about $400 you can buy a comercial license.
PostgreSQL is licensed under the BDS, which means you don't ever have to pay to use it.
Both have ODBC drivers (myODBC and psqlODBC), so talking to them from LabVIEW is a no-brainer.
PostgreSQL has more features like store proceedures and subqueries, so if you have complex data processing, you can handle them on the server side.
MySQL has fewer features and is probably simpler to administer, but I _think_ that the next version might have subquery capabilities. It's also faster for simple commands.
As far as BLOBs are concerned, here's what I dug up:
In Postgres, Large Objects are very special beasties. You need
to create them using lo_create function and store the result of the function - OID - in a regular table. Later you can manipulate the LOB using the OID and other functions - lo_read/lo_write, etc. Large object support is broken in Postgres - pg_dump cannot dump LOBs; you need to develop your own backup mechanism. Tthe team is working on implementing large rows; this will replace current LOB support.
In MySQL, text and binary LOBs are just fields in the table. Nothing special - just INSERT, UPDATE, SELECT and DELETE it the way you like. There are some limitations on indexing and applying functions to these fields.
I hope this is enough to get you started. I suggest you STFW (Search the Fine Web). You will get many results from "MySQL vs PostgreSQL".
Here are a couple that I found.
http://phd.pp.ru/Software/SQL/PostgreSQL-vs-MySQL.html
http://www.webtechniques.com/archives/2001/09/jepson/ -
hello
how can i create a connection to mysql and postgresql databases in jdbc. without using odbc.
thanks.You need to use a different driver. I assume you're using the jdbc-odbc bridge driver.
For mysql, get the mm.mysql driver at http://mmmysql.sourceforge.net/
For postgresql, go to http://jdbc.postgresql.org/
I've only used the mysql driver, so I don't know the details of how to use the postgresql one.
In general, you will have to do the following:
1. download the jar file and put it in your classpath
2. change the connection url string to conform with the format in the driver documentation. -
Clob mapping not working with mysql
Hi,
I have an application that i'm running with MySQL and Oracle at the same
time. At some point, i need to use a 'clob' mapping. When i do this, it
just works fine with oracle but it fails with mysql. i have the exception:
Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
is mapped as a clob, but should be represented as a different mapping.
If the field is a string and you would like to force it to map as a
clob, add an extension to its field metadata with a key of "jdbc-size"
and a value of
-1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
at
kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
if i use a value mapping, it works with MySQL but fails with Oracle (I
have sql error because a clob is used in a distinct select).
In the manual, it is written "Note that some databases can support
string of unlimited length without using a CLOB; when this is the case
the mapping tool will install a value mapping in favor of
this mapping.". So apparently, this is not the case with MySQLDictionary.
To solve my problem and have my code working with both databases, i had
to extend the MySQLDictionary and overwrite the replaceFieldMapping
method in order to replace the clob mapping by a value mapping at
runtime but i don't feel confident to do this kind of modifications by
mysel and would expect this behaviour to be solved quite soon.
Thanks for your help since this problem is urgent for us,
Laurent CzinczenheimLaurent-
The best solution would probably be to just have separate mappings for
the MySQL and Oracle databases. The easiest way to accomplish this would
be to have a separate setting for each of the databases. E.g.:
kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=oracle.mapping)
kodo.jdbc.meta.MappingFactory: file(SingleFile=true, FileName=mysql.mapping)
That way, you can use a clob mapping for Oracle, and a normal value
mapping for MySQL (since MySQL doesn't need to use the CLOB mapping, and
it isn't very efficient).
For more details on this, see:
http://docs.solarmetric.com/manual.html#ref_guide_mapping_factory
Another solution is to just stick with your custom extension of the
MySQLDictionary, which is a perfectly valid way of having special CLOB
handling in MySQL. Note, though, that CLOB handling is less efficient
than VARCHAR handling, so it should be a mapping of last resort, and
there isn't any need to use it in MySQL.
In article <[email protected]>, czinczenheim wrote:
Hi,
I have an application that i'm running with MySQL and Oracle at the same
time. At some point, i need to use a 'clob' mapping. When i do this, it
just works fine with oracle but it fails with mysql. i have the exception:
Field "com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description"
is mapped as a clob, but should be represented as a different mapping.
If the field is a string and you would like to force it to map as a
clob, add an extension to its field metadata with a key of "jdbc-size"
and a value of
-1.[com.ennov.prisma.api.document.jdo.AbstractDocumentPO.description]
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:132)
at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:118)
at
kodo.jdbc.meta.ClobFieldMapping.fromMappingInfo(ClobFieldMapping.java:46)
if i use a value mapping, it works with MySQL but fails with Oracle (I
have sql error because a clob is used in a distinct select).
In the manual, it is written "Note that some databases can support
string of unlimited length without using a CLOB; when this is the case
the mapping tool will install a value mapping in favor of
this mapping.". So apparently, this is not the case with MySQLDictionary.
To solve my problem and have my code working with both databases, i had
to extend the MySQLDictionary and overwrite the replaceFieldMapping
method in order to replace the clob mapping by a value mapping at
runtime but i don't feel confident to do this kind of modifications by
mysel and would expect this behaviour to be solved quite soon.
Thanks for your help since this problem is urgent for us,
Laurent Czinczenheim
Marc Prud'hommeaux
SolarMetric Inc.
Maybe you are looking for
-
To Add a new column for ZPR0 prce in open sales order report
HI, my requirement is To Add a new column for ZPR0 prce in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 p
-
Attempted to download new ios 8.2 software, I can't use my phone now as it is saying connect to iTunes?! So I connected to iTunes and it isn't doing ANYTHING. THIS IS CRAZY!!! Apple - GET YOUR CRAP TOGETHER!! Don't release an update if it isn't read
-
Scripting the path in Quick Selection Tool
Hi, I'm trying to build a JS script which: 1. opens an image 2. selects the quick selection tool 3. does the selection following a pre-defined path 4. puts the unselected area to white 5. saves the image The problem is in step 3. All the other steps
-
Hello All, I got a table called TAC_CODE_MASTER and TAC_CODE is one of its field. TAC_CODE is 8 characters long and it can hold upto 8 charaters If i were to find a data such as 'A2345678' and if this does not exist then I should get the most possibl
-
Hello All, my question about open_cursor.the scenario is as under 1sqlplus scott/tiger 2.select * from emp; in scott schema 3.open_cursor=1 4.select * from emp; in same scott schema 5.open_cursor=1 can you tell me why open_cursor value is not increas