Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am unable to see mysql in connection profile in eclipse, I have tried of creating a new connection but all in vain.
Also how can I solve class not found error.
Install Eclipse on your computer
Download JDBC (Java DataBase Connectivity) from http://www.mysql.com/products/conector. Select "Platform Independent"
Unzip/unpack it. Open the new folder create
by the unpacking. Make sure you see a jar file in the folder, with a
name similar to mysql-connector-java-5.1.34-bin.jar
Create a new java project in Eclipse. Call it MySQLTest1 (or whatever name you want).
Drag & drop the JDBC connector jar file
(mysql-connector-java-5.1.34-bin.jar) to your project in Eclipse.
Select copy file and not "link file".
Create 2 java classes in the
project (source code given below)
Main.java, and
MySQLAccess.java
Click on mysql-connector-java-5.1.34-bin.jar in the project to
highlight it
Control-click or right-click on it to open the pop-up:
pick Build-Path, and then Configure Build-Path
A new window opens
up. In the right hand-side, click on the Libraries tab.
Click on Add
JARs
In the JAR Selection window, double-click on MySQLTest1 (or
whatever your project name is).
Select the
mysql-connector-java-5.1.34-bin.jar library.
Click Ok.
The mysql
connector is now a library available when compiling your java code.
Related
I'm beginner in hybris. I need to create a jasper reports, using flexible search and mysql server. But I can only use the sql query statement without flexible search in report file (Jrxml source file (.jrxml)).
How can I using the flexible search with mysql?
Are you following the guide provided in Hybris Help for building a custom report? It can be found at https://help.hybris.com/6.3.0/hcd/8b6e40ee86691014b99eda29aebc9d84.html
In the interest of having a source of information in case the link ever becomes dead:
Go to ${HYBRIS_DIR}/hybris/bin/platform
setantenv.bat for Windows or . ./setantenv.sh for Unix/Linux
Go to ${HYBRIS_DIR}/hybris/bin/ext-platform-optional/virtualjdbc
Run the ant command ant dist
Go to ${HYBRIS_DIR}/hybris/temp/hybris/virtualjdbc. You should have two files that have been generated here, hybris-virtualjdbc.jar and vjdbc.jar
You now need to copy these two files to ${HYBRIS_DIR}/hybris/bin/ext-platform-optional/virtualjdbc/lib
Download the Jaspersoft Studio Tool at http://community.jaspersoft.com/project/jaspersoft-studio
Install and Open Jaspersoft Studio
Go to Tools > Options > iReport > Classpath
Click Add JAR twice, each time selecting one of the newly copied JAR files (hybris-virtualjdbc.jar and vjdbc.jar)
Click OK
You now need to setup the Data Source, to do this:
Click on the Report Datasource icon ()
In the newly opened window, click New
Select Database JDBC Connection and click Next
On the next screen you may provide any name for your JDBC Connection
In the JDBC Driver field, make sure you type de.hybris.vjdbc.VirtualDriver
In the JDBC URL field, make sure you type jdbc:hybris:sql:http:///virtualjdbc/service, where is the location of your application server (e.g. https://localhost:9002). Remember this will change with each environment!
Provide a Hybris User for the Username and Password. It may be worth using the admin user to begin with, but make sure you lock it down at a later stage to a user with less access, such as vjdbcReportsUser
Test the connection. Remember you will need the server up and running to be able to use vjdbc
From here onwards, you should be able to create a report using Flexible Search style syntax!
I'm trying update my custom component which I had created.
The version number when I installed was 0.0.1. Later on I had to do some changes in the table (had to add a column). So I changed the version number to 0.0.2 and I created a sql file with name 0.0.2.sql.
But when I try to update in extension manager. ie, extension -> manage -> discover -> clicked on discover button. it didn't show my component.
How do I update the component?
When the component is already installed then whatever changes you make to files wont display under discover, unless you are changing the folder names. Better to change the version in xml and add the sql file, zip your component and reinstall it. Remember to have method="upgrade" in your xml file.
I'm following these steps to build sdrsharp on stable Debian. So fr, everything went without a hitch, but I can't figure out this step:
cd into the new sdrsharp directory and then load monodevelop and open the sdrsharp.sln project. If the .sln doesn't open use a text editor to open the .sln file and at the end of the first line change the 12.00 to 11.00. Older versions of monodevelop don't understand the VS2012 header.
Set the Active Configuration from Debug|x86 to Release|x86.
The first one is just given for context, monodevelop has no problem opening the file. But how do I change the Actove Configuration?
Monodevelops internal help is broken, I have no experience with monodevelop or similiar tools as I'm no coder, hence asking here.
Edit to add
The same question was asked and answered here, there should be an option under the "project" tab. But in my case, working from the downloaded .sln, all options under project are grayed out. What to do?
Fixed! The Version had to be changed back to 11 (first bullet point above, relevant to my special case), then reopen file, then it's opened as a project, not as a text file and all the options work.
Take home lessen: That a progeam opens a file without complaining does noit mean there's no error.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
As a web developer I'm constantly working on projects in different environments (local, staging, testing, production). I mostly work on Drupal projects. I can't tell you the number of times I've been led from local to production by just browsing the site. And then accidentally changing a setting on production that was really only supposed to be changed on my local environment.
So here's an idea: A Chrome theme that changes color depending on the sub domain of a site.
For example: on local.mysite.com* the browser chrome should be green, on staging.mysite.com* it should be blue, and on mysite.com* the color should be standard chrome grey.
This could avoid a lot of confusion for a lot of people working in different environments. Not only for developers, also for "content" people.
Sadly, I have no idea how to code a Chrome theme with that kind of behavior.
Themes are not dynamic, so the solution is not straightforward.
It's possible to create the feature using the management API. At least three extension are needed:
The main extension for switching themes.
Theme #1, theme #2 etc (an extra extension for every additional theme).
How to
Create a theme - See the Chrome themes documentation.
Bind a chrome.tabs.onUpdated event to listen for tab changes, and possibly save the state of known "theme-tabs" in a hash (by tabId). Don't forget to remove the tabId when the tab's URI is not "special" any more, using the delete operator.
Create another extension, with a background script.
Add a chrome.tabs.onActivated Warning: See below event, to listen for tab changes. This event is passed a windowId and tabId. Use the hash, created in step 2, to check whether the theme has to be changed or not.
If the URL matches a certain pattern, activate the new theme using the chrome.management.setEnabled method.
Alternative approach for step 3-4: Use Content scripts to call a method the background page. The match patterns can then be set in the manifest file, at the "content_scripts", "matches" section.
Warning: The onActivated event was not supported prior Chrome 18. Before Chrome 18, the event was called onActiveChanged.
The extension as described in steps 2-4 requires the following permissions:
management
tabs
My solution is to use PHP to detect what server I am connected to and then update Administrative screens of my application (WordPress, Drupal etc.) with a specific color. You could also display a color bar at the top of local and staging sites as well.
Here is what I do for WordPress admin screens:
// determine if this is development, staging or production environment
if (strpos(home_url(),'http://localhost') !== false)
{
define('MY_ENVIRONMENT', 'DEV');
}
else if (strpos(home_url(),'<enter staging URL here>') !== false)
{
define('MY_ENVIRONMENT', 'STAGE');
}
else
{
define('MY_ENVIRONMENT', 'PROD');
}
And then I used this to show specific colors in WordPress admin screen:
function change_admin_color($result) {
return (MY_ENVIRONMENT== 'PROD' ? 'sunrise' : (MY_ENVIRONMENT== 'STAGE' ? 'ocean' : 'fresh'));
}
add_filter('get_user_option_admin_color','change_admin_color');
I'm having a silly problem : I'm trying to add the Jsoup library (which is just an external jar) to my android application developed in Intellij Idea and it seems and don't do it right .
I put the library in the libs folder , then I went in Project Structure -> modules and selected dependencies , select add global library , select attach source and click ok.
When I write code it is able to automatically import classes and to compile , but when running I get " java.lang.NoClassDefFoundError: org.jsoup.Jsoup"
Copy the .jar file into your lib/ directory.
Right click the new .jar in the lefthand file browser in IntelliJ / Android Studio
Choose "Add as Library..."
Voila!
-Open the External Libraries node on the Left hand panel.
-Select Open Library Settings
-Project structure dialogue opens up.
Select the Libraries.
Click the "+" to browse the file.
![add external jar1
In IntelliJ IDEA 15 you can also access the Project Structure menu item from "File" item in the menu bar. Select Libraries from the list on the left. Click the "+" to browse the file, select it and you're done. It will be added to the "External Libraries" directory in your project.
Have a look at the newer artifacts section. Perhaps you don't add the JAR into your deployment properly.
UPDATE:
I'd like to update my answer based on lessons learned over the past six years since I first answered this question.
The best way to manage 3rd party JAR dependencies in Java projects is to learn Maven (my preference) or Gradle. IntelliJ has terrific integration with both.
If you combine those with an enterprise repository like Nexus you'll have no problems. Your dependencies and versions will be completely specified. Conflicts will be identified for you. Updates will be relatively simple.