Setuping DB Navigator(SQLite) for PyCharm - database

I have not been having luck setting up a connection to SQLite3 through DB Navigator. I have read over the documentation, but it seems to be out of date and doesn't explain how to actually set up a connection. My set up screen doesn't even look like what is pictured in the docs. The built int help doc just errors and says it can't find the document.
When I try to test the connection, I get the error "Database information incomplete or invalid (host, port, database, file)". I have tried host = localhost, port=22(default). There is the option to enable 'Use SSH' but disabling doesn't change the result. There are fields for Username, and Password. I'm not sure what they want in there. Currently I have 'system' and a random password.
Database file(a single field) is the path to the dir that the database is in. The field 'main' I have the name of the database file itself. Driver Source is the default of built-in library.
What fields am I missing or have in wrong? I can connect to this through VS with both SQLite and SQL server, but not PyCharm.
EDIT:
Finally figured it out. Single SQLite has no username or password capability, I needed to leave all of that disabled. In the database field I browsed and navigated to the file and selected the whole file instead of just the dir. The Main field was left empty.

I figured out that the plugin has a bug.
Step 1 - To connect to the databases you need to enable Auto-Commit and Connect Automatically in DB Navigator.
Step 2 - In DB Navigator > Settings > Database files, you need to add the database file's name, to click in the green add button and then press Enter.
If you still get the error but the connection was succesfully, don't worry, it's just a bug.
But if you get the error and you database connection it's not working, you must follow the Step 2 again, but now change the database file's name path, without include the name of the file and press Enter. Open DB Navigator > Settings > Database files again and now put the database file's name, to click in the green add button and then press Enter.
I've read about this problem in 2014, but nowadays this problem is still alive. Maybe, when you put the paths, there's no refresh in the database file's path and the connection can not be established.

I just solved this issue saving the database file in a different folder, it seems like the problem are the space characters (and maybe other special characters) on the path.
For example something like C:\Users\Wile E Coyote\Acme Files\MyDataBase doesn't work, but something like C:\Users\RoadRunner\Beep\MyDataBase works.

Related

Notes Federated Login not downloading in memory ID file - Entry not found in index

We have setup Notes federated login to provide a single-signon for Notes clients from Active directory. and there seem to be a problem when getting the "in memory" ID file from the Vault.
Here is the scenario
User start Notes (tried both v9 and V10) for the first time
Enter password in the Login screen for the local id file.
Message prompt "ID file is now downloaded for Notes Federated Login"
User click "OK" and a new message show up "Server Error - Entry not in index"
User click "OK" and then the passsword prompt for the local id file is displayed.
So, in short there seem to be a problem when downloading from the Vault but the error message do not really say much.
We have enabled all the client debug options and checked the server logs but nothing really tells us what is wrong.
All we get is this:
An issue that failed to authenticate was reported from the server / domain server: Entry not in index
Id-file is already in use and can't be changed
I can't diagnose the issue from reading your problem description. I suggest you open a support ticket with the steps to reproduce. ERR_NOT_FOUND (not found in index) is a very common return value in Domino, often even being benign. But in the benign cases it is handled by the calling code.
So it's hard to know what method/function threw the error or what the stack was at the time. Hence the advice to open a support ticket.

Cakephp with Rackspace cloud database

I'm thinking about moving one of my clients mysql db to Rackspace could databases. Application is using Cakephp.. I would like to know if someone has experience doing so or will this work just by editing host/user/pass in the database.php file?
I havn't done so but Rackspace has a tutorial about doing so :
http://www.rackspace.com/knowledge_center/article/installing-cakephp-on-cloud-sites
It seems pretty simple, so you should not have any problems
Steps for cake
Locate the .htaccess file in the content directory. After "RewriteEngine on", add a new line with "RewriteBase /" to the .htaccess file and save the file back to the site. You will need to repeat this step for the rewrite rules in the .htaccess files in the app and app/webroot directories.
Load the site in your browser. You will notice several warnings concerning the installation. The first warning will be the following: Notice (1024): Please change the value of Security.salt in app/config/core.php to a salt value specific to your application [CORE/cake/libs/debugger.php, line 556].
Open app/config/core.php file and search for Security.salt. Change its value to whatever characters or string you would like, then save and close the file.
In the app/config/directory in FTP, rename the database.php.default file to be database.php.
Open app/config/database.php and scroll down to the bottom of the page to find the database connection information. Enter your database host name, user name, password and hostname, then save and close the file.
Reload your site in your browser.

How to create web service using Database adapter in OSB Console?

I have a requirement to use OSB with DB Adapter as for given task, I believe BPEL Process will not be better performer than OSB. I have gone through some sites but all of them are demonstrating OEPE not OSB Console. Any response will be appreciated.
I have similar requirement in my project and I was wondering here and there. Here is final solution of the problem. I documented for you guys.
Steps in JDeveloper
1. Create DB Connection in JDeveloper.
2. Create a Generic Project.
3. Create Project as SOA project and use Empty Composite.
Steps to create DB Adaptor
Go to Composite Palette and choose AD Adaptor.
Drag and drop the DB Adaptor in the External Reference section (right side of Composite view).
It will open a wizard for selecting the connection and Other DB related process.
Give name to service that you want to create
Choose the DB Connection you have created already.
Move one with selecting your desired choice of Stored Procedure or Table (insert/Select) functionality that you want your web service to perform.
If you choose Table insert/Select then you can also choose the relation between tables as optional step.
Try to keep all steps default if you do not want any special features.
Once you finish all steps in wizard, then it will generate whole lot of files under your Project.
Look for 4 main files .jca, xsd/.xsd, *.mapping.xml, *.wsdl
If you see all these files generated well in your project then you are all set and we can move ahead. If not then look for the issue.
Steps in WLS Console
Create Data Source
1.Go to Left panel and choose Data Source.
2. Select New -- Generic Data Source
3. Give Name as you wish but for JNDI Name you have to use the connection name from the *.JCA file that you already have. Open the jca file and search for the ‘UIConnectionName’. This value will be used as JNDI name in data source creation.
4. Choose Driver as oracle.jdbc.xa.client.OracleXADataSource
5. Use the host and Port and other details that you had selected during DB Connection (in JDeveloper). This is obvious step.
6. Choose target AdminServer.
7. If you finish everything correctly. You are all set here and you can choose to test the connection and should be Test Success.
Configure the DB Adaptor
Go to Deployment on left hand panel.
In Deployed services. Search for DbAdaptor.
Click on the name DbAdaptor.
Select Configuration tab. And under it choose Outbound Connection Pool.
Here you will see (javax.resource.cci.ConnectionFactory)
Click on new.
Choose javax.resource.cci.ConnectionFactory
Next page will ask for JNDI Name. For this, you have to go to your *.jca file and choose the value which is already there for Connection-factory as Location (like connection-factory location=?). Use the value of Location as JNDI Name.
Transaction will be No Transaction. Choose this for now. This is need basis selection.
Leave other selection as is and then Finish.
Note : Once you finish. Go to Properties Tab again and look for a property name : xADataSourceName. Its value should be the same as UIConnectionName that you have in *.jca file. It should be populated. If not then you can set now as well. You have to double click on the value section and then write the name and press enter. Then Save it.
With above all steps we have set the DbAdaptor to point to same DB where we have our table/store procedure.
What we did above is:
• We Have JCA File and WSDL for our service. Along with DB Setting.
• We have a Data Source for our DB in WLS.
• We have the deployed DbAdaptor in WLS which is pointing to the same JNDI.
Steps in OSB Console
Create a Project.
Create 3 folders under Project. Like Resources, Proxy Service, Business Service.
Activate your project.
In Resources folder. We have to add JCA Mapping. Point it to the *.jca we already have from above steps (We had created it JDeveloper). Just give the path and Save. It may give you Error. Ignore for Now.
In Resources Folder. Add a WSDL and give the path of your *.wsdl. If it give Error. Then ignore for now.
In Resources Folder. Add a XSD and give path for the *.xsd we already have.
In Resources Folder. Add a XML and give path to the file *Mapping.xml.
Revisit resource WSDL again and click on its name. “Edit References”. Choose the XSD you already have and Save.
Revisit resource JCA and click on its name and edit reference and point it to the mapping.xml
By now you will see all errors gone.
Activate your project.
Go to Left hand side and select the Business Service and Create Business Service by selecting the wsdl project. On next page select Binding.
Then select JCA and give the ‘Location’ of IES (remember we have a value in connection-Factory in *.jca as Location. We had used it while creating DbAdaptor). Give that value here.
Move to next, next and next and finish.
Your business service is all set.
Now create a Proxy Service. Select Proxy Service and choose from B usiness Service option and do select the Business service you have create in above step.
Then click done
Activate your project.
That’s it we are all set. In proxy service you can click and see what is the End Point URl and keep it safe for your future reference. This is the url that we hav eto give on Client to call our service.
With this we all Done.
Call from Client.
Select SOAPUi for this purpose.
Create new project and give the end Point URL.
It will show all the services in it.
Select one service. Create Request.
Put the values in Request XML and Use the endpoint URL by appending your Localhost:port.
Click go and you will see the response back.
So, Finally : We are done with testing a OSB project with DB adaptor.
This looks long, but once you do it, its very easy for next services.
Thanks, Hope that will help.
The OSB Console does not support creation of the JCA DB Adapters, and neither does OEPE.
You need to create the DB Adapter in JDeveloper and then import it via OEPE/OSB Console. OEPE is easier ;-).
For a guide, see:
http://guidoschmutz.wordpress.com/2010/08/08/oracle-service-bus-11g-and-db-adapter-a-different-more-integrated-approach/
or
https://blogs.oracle.com/middleware/entry/using_jca_adapter_with_osb_11113

Connect MS access database in JSP pages

I would like to ask you how can I connect a MS access database in JSP pages?Do you know any ready class which I can use?I am using Netbeans to create JSP pages!
Ancient question, but I shall answer anyway. Had to Google around a bit when the same question flummoxed me. Here goes (concise version of stuff found here):
Administratively Register Database
Use MS Access to create a blank database in some directory. (eg. Database1.mdb.) Make sure to close the data base after it is created.
Go to: Control panel -> Admin tool -> ODBC
Under the System DSN tab (for Tomcat version 5 or later – User DSN for earlier
versions), un-highlight any previously selected name and then click on the Add
button.
On the window that then opens up, highlight MS Access Driver & click Finish.
On the ODBC Setup window that then opens, fill in the data source name. This
is the name that you will use to refer to the data base in your Java program – like
arc. This name does not have to match the file name.
.
Then click Select and navigate to the already created database in directory.
Suppose the file name is Database1.mdb. After highlighting the named file,
click OKs all the way back to the original window.
Connect a JSP page to an Access Database
<%# page import="java.sql.*" %>
<%
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=null;
conn = DriverManager.getConnection("jdbc:odbc:arc", "", "");
out.println ("Database Connected.");
%>
Now that the JDBC-ODBC Bridge has been removed from Java 8, the UCanAccess JDBC driver may be a more relevant option for future users. For details, see the related Stack Overflow question
Manipulating an Access database from Java without ODBC

Cakephp loads old database config file

I developed a small cakephp website on local machine. When I upload to my host server, I realize that I must use their prefix for the database name and database user. So, I go and create new database name and new user. When I visit the site, it has this:
Warning (2): mysql_connect() [function.mysql-connect]: Access denied for user 'old_name'#'localhost' (using password: YES) [CORE/cake/libs/model/datasources/dbo/dbo_mysql.php, line 552]
I am 100% sure, I already change the name to "new_name", it runs on my local machine, but I dont know why it still load the old name. I go to ftp, and download the database config file, it clearly stated that, the database user is "new_name", i dont understand why when I go to the site, it loads the old database config. I am new to cakephp, please help.
try to clear the files from your app/tmp directory and tripple check the configuration.
Sometimes it can take a while for files to become live. One host I use has a folder for upload and then they transfer to the live folder from there automatically. Could it be something like this?
You possibly need to specify an IP for the database instead of localhost. Often the database is hosted on a different server to the code.

Resources