Play! Framework 2.2.3 SQL server connection - sql

I have a Play! Web-app that I am developing and I'm currently using an eBean YAML database. I have a 2008 SQL server that was set-up for me by a coworker that I'd like to connect to. I tried following another tutorial on this site
PlayFramework MSSQL Database error
and downloaded the jtds jar file and placed into the proper directories but I'd get an error that the driver is not found. This is my current configuration file:
db.default.url="jdbc:jtds:sqlserver://LSA5A:1433/DatabaseName=hr_site;instance=SQL2008"
db.default.driver=net.sourceforge.jtds.jdbc.Driver
db.default.user=HUser
db.default.password="RaeSusdaRasdh!123"
I have never set-up a database like this before so I'm having difficulty understanding how to set it up and how it will all works together. I didn't understand the solution from the Play! Docs for this and I'm not using MySQL so I couldn't find the help I needed online. I'm not sure what other information I need to provide but I'm running SQL server 2008, db name is SVFSSQL5A with user HRTUser and password testPass12. Thanks for your help!!
Also I have the dependency in my build file:
val appDependencies = Seq(
"net.sourceforge.jtds" % "jtds" % "1.2"
)

I did this:
Download the SQL-Driver for JDBC from Microsoft http://www.microsoft.com/de-DE/download/details.aspx?id=11774, install it and put the sqljdbc4.jar file in the lib folder ( \YourProject\lib).
application.conf file:
db.default.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.default.url="jdbc:sqlserver://localhost\\instancename:1433;databaseName=MyDBName"
db.default.user="sa"
db.default.password="MyPassword"
db.default.logStatements=true
Enable the TCP\IP protocoll and the port 1433 in the SQL Server Configuration Tool.
That should do the job!
Manfred

Related

Errors on importing sql file in phpMyadmin

Here is a snapshot of the errors.
I am using xampp on ubuntu to run the mysql server. The error says to check the manual of MariaDB server , so does xampp support that or is there something wrong with the SQL query? . This SQL file was provided in a github project Github project link . If what I am doing to import this SQL file to create the database is totally wrong, please suggest the correct way to do it.
A snippet of the SQL file
https://drive.google.com/file/d/1AWPWgBq8xHV-zfPHAKngFQI66JwVHv71/view?usp=sharing This is the SQL file

DBVisualizer and HIVE

I am using DBVisualizer 9.2 and Cloudera 5.4.1
I want to setup my db visualizer such that I can query hive database from the dbvisualizer tool.
I downloaded the jdbc driver for HIVE from here
http://www.cloudera.com/downloads/connectors/hive/jdbc/2-5-16.html
I extracted all the jar files in /Users/User1/.dbvis/jdbc
But now, when I start dbvisualizer, I get an error
Ignored as there is no matching Default Driver for "com.cloudera.hive.jdbc41.HS1Driver", "com.cloudera.hive.jdbc41.HS2Driver"
/Users/User1/.dbvis/jdbc
HiveJDBC41.jar
TCLIServiceClient.jar
hive_metastore.jar
hive_service.jar
libfb303-0.9.0.jar
libthrift-0.9.0.jar
log4j-1.2.14.jar
ql.jar
slf4j-api-1.5.11.jar
slf4j-log4j12-1.5.11.jar
zookeeper-3.4.6.jar
So my question is, has anyone successfully configured the DBVisualizer tool to connect to cloudera hive server?
After several hours of troubleshooting. I was able to resolve the error and successfully connect to HIVE from DB Visualizer using the HIVE JDBC Driver from cloudera.
These are the steps I took
First go to Tools -> Tool Properties -> Driver finder paths.
Here register a new empty directory. this will be the place where you will download all your jars.
First in this directory extract all the JAR files which come along with the cloudera JDBC Hive Driver.
http://www.cloudera.com/downloads/connectors/hive/jdbc/2-5-4.html
Now go to Tools -> driver manager and select Hive. In the "user specified" tab. click on the "folder icon" on the right hand side and select all the jar files which you just unzipped. (not just the folder... select all jars).
Make sure you select com.cloudera.hive.jdbc41.HS2Driver
Now define connection to Hive using these parameters
url: jdbc:hive2://foo:10000/default
user: admin
password: admin
Now when I tried to connect, I still got errors.
"Type: java.lang.reflect.UndeclaredThrowableException"
In order to resolve the above, I you need to see the error log. (this was the most important step).
Tools -> Debug Window -> Error log
Here I saw that the mysterious "UndeclaredThrowableException" is occuring because a bunch of class files like http utils, http core, hadoop core, hive core and hive cli jar files were missing. I downloaded these jars from maven central
hadoop-core-0.20.2.jar
hive-exec-2.0.0.jar
hive-service-1.1.1.jar
httpclient-4.5.2.jar
httpcore-4.4.4.jar
and again I went inside Tools->DriverManager -> Hive -> user defined and clicked on folder on right hand side and selected each of these jars as well.
Now when I restarted DBVisualizer, I connected to hive just fine and I can query it using DBVisualizer.

Pentaho (5.0.5) Configuring for Mysql

I installed Pentaho BA suite 5.0.5 on linux platform. Everything works well in postgreSQL repository.
I REFERRED THIS LINK To Configure Mysql as reposity
But if try to configure mysql for pentaho, i'm facing Errors.
This are the changes i did :
1.Edited /home/pentaho/server/biserver-ee/pentaho-solutions/system/quartz/quartz.properties
line:300
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
2.Edited /home/pentaho/server/biserver-ee/pentaho-solutions/system/hibernate/hibernate-setting.xml line:15
system/hibernate/mysql5.hibernate.cfg.xml
3.Edited /home/pentaho/server/biserver-ee/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hibernate
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.MySQLDialect
4.I copied audit_sql.xml file from /home/pentaho/server/biserver-ee/pentaho-solutions/system/dialects/mysql5 to /home/pentaho/server/biserver-ee/pentaho-solutions/system
Edited /home/pentaho/server/biserver-ee/pentaho-solutions/system/jackrabbit/repository.xml file and uncommented SQL-configuration
I copied mysql-connector-java-5.1.25-bin.jar file to tomcat/lib folder
i made changes in /home/pentaho/server/biserver-ee/tomcat/webapps/pentaho/META-INF/conetxt.xml file
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate"
validationQuery="select 1" /> in jdbc /hibernate section
driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/quartz"
validationQuery="select 1"/>
in jdbc/Quartz section
I'm facing these errors :
1.pentaho.log file :EmbeddedQuartzSystemListener.ERROR_0001 - Scheduler was not properly initialized at startup
2.In pentaho user console ,Loading symbol remain forever without displaying files.
3.i'm not able to save reports.
That might be very simple - but pentaho platform is not shipped with mysql jdbc driver by default due to some kind of licensing issues.
So it is required to manually obtain mysql jdbc driver and put it into web server lib folder.
For tomcat (default installation) that will be /servers/.../tomcat/lib folder.
For this particular case that may be
/home/pentaho/server/biserver-ee/tomcat/lib
One more advice is to check full log under
/home/pentaho/server/biserver-ee/logs
That is the main place where pentaho platform keeps logs info.
Hope it will help.
By the way there is a pretty good pentaho info portal about configuring pentaho platform:
http://infocenter.pentaho.com/help/nav/2_3
Make sure you are pointing to Java 7 in your JAVA_HOME. When you have your JAVA_HOME pointing to Java 8, BI Server will not start correctly
This is a pentaho bug. Create a table in quartz database of mysql like this postgresql table:
CREATE TABLE "QRTZ"
(
name character varying(200) NOT NULL,
CONSTRAINT "QRTZ_pkey" PRIMARY KEY (name)
)

Unable to build Worklight project for "test" server (JDBC error)

Hello worklight team and devs!
We are done working on our development project and everything works fine in the local dev server (Tomcat).
Now we are trying to build the project to be deployed to a testing WAS ND 8.0.3 server.
We've been following the manual in the infocenter and modified each required file as needed (worklight.properties and application-descriptor.xml)
We made this changes to the worklight.properties file:
publicWorkLightHostname=working.hostname.com
# http or https
publicWorkLightProtocol=http
# For default port leave empty
publicWorkLightPort=ourport
publicWorkLightContext=/worklight
wl.db.jndi.name=jdbc/WorklightDS
wl.db.type=DB2
wl.db.url=jdbc:db2:Worklight
wl.db.username=wluser
wl.db.password=passwd
We tested the jdbc source in the WAS console and it works perfectly.
We proceed to build the war, adapter and wlapp (ALL) and we get this error:
[2013-05-21 12:48:44] FWLSE4001W: Failed to resolve JNDI name: "jdbc/WorklightDS".
Application may fail to access the database in runtime. If building for remote server - ignore this warning.
[2013-05-21 12:48:44] FWLST0011E: ====== Worklight Project BPMWorklight-project-customization failed to start: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
[2013-05-21 12:48:44] Activation failed. Bundle didn't start:C:pathto\BPMWorklight-customization.jar
This happens in the developer workstation and if we install Studio in the server, where the jdbc source is created, the same happens.
I guess that Worklight is trying to "obtain" a JDBC source in TOMCAT not WAS, but we are building for WAS, so the build fails and NO files are changed after the error. NO BUILD is executed.
We also tried to execute the build.xml with ANT in studio but we get this error:
Buildfile: C:\Users\Primary User\IBM\Worklight\LIS_SampleCollection\BPMWorklight\build.xml
BUILD FAILED
C:\Pathtofile\BPMWorklight\build.xml:3: Cannot find ../../common.xml imported from
C:\Pathtofile\BPMWorklight\build.xml
Total time: 62 milliseconds
You're help is greatly appreciated!
Thanks a lot!!
Best,
Nicolas E.
If all you require is to deploy the updated-for-WAS .war file in WebSphere, you don't need to do any build operation in Worklight. After updating any file under the server\ folder in Worklight Studio (the Eclipse plug-in), the .war file is automatically being re-created.
The build operation is mainly for creating the binaries and deploying to Worklight Server (database) (again, when using the Eclipse plug-in).
So what I suggest is to:
First update application-descriptor.xml with your context root value in worklightServerRootURL, and keep your .wlapps on the side
Update worklight.properties and save them.
Now you have your app ready to deploy and the .war file ready to deploy.
Move to WAS, deploy the .war file
Hopefully things will work now, so you can load Worklight Console and deploy the .wlapp and .adapter files.
I don't know what you've read in the IBM Information Center, but you can also try going over the following training module from IBM Worklight Getting Started.
Moving from development environment to stand-alone QA and production servers
Notes:
The above is not so convenient, but it is A way to move from your
development environment to another staging environment, or
application server...
The issue might also happen even after following my steps above, and this will indicate that the real issue is in your DB2 declaration in worklight.properties.
I will update this answer tomorrow with some insight regarding the possible DB2 declaration issue.

WebLogic--->Cannot load driver: com.mysql.jdbc.Driver

i have a problem in creating a data source in weblogic application server 10.3, i'm making a JDBC connection for MySql database , i placed the mysql driver in the lib folder of weblogic \wlserver_10.3\server\lib and in the mysql folder wlserver_10.3\server\ext\jdbc\mysql independently and the error message still arises
Note: there was a two jar files in this folder wlserver_10.3\server\ext\jdbc\mysql and i removed them to avoid any conflict, how i can solve these problem??
Are you using or need a different driver than the one that comes with the weblogic install? If you are you will need to add it to the CLASSPATH in setDomainEnv.sh. Otherwise it will default to using:
\wlserver_10.3\server\lib\mysql-connector-java-commercial-5.x.x-bin.jar
We had to add additional Oracle jars to our CLASSPATH recently for secure connections. You can check into it more here: http://docs.oracle.com/cd/E13222_01/wls/docs100/jdbc_admin/third_party_drivers.html
If somebody looks for a solution how to add JDBC driver (in my case PostgreSQL) to a Weblogic 14c installation attached to IntelliJ IDEA:
The location of jar-file doesn't matter. It is not needed to put it into the server's lib directory.